Android Open Source - matkakortti-widget Utils






From Project

Back to project page matkakortti-widget.

License

The source code is released under:

GNU General Public License

If you think the Android project matkakortti-widget listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Matkakortti Widget is licensed under GPLv2.
 * See LICENSE.txt for more information.
 *//*w ww  . j a  v a  2 s  .  com*/

package fi.iki.dezgeg.matkakorttiwidget.gui;

import android.content.SharedPreferences;

import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Map;

public class Utils {
    public static boolean isConnectionProblemRelatedException(Throwable e) {
        if (e instanceof UnknownHostException)
            return true;
        if (e instanceof SocketException)
            return true;

        if (e.getCause() != null)
            return isConnectionProblemRelatedException(e.getCause());

        return false;
    }

    public static String prefKeyForWidgetId(int appWidgetId, String key) {
        return "widget_" + key + "_" + appWidgetId;
    }

    public static void dumpPrefs(SharedPreferences prefs) {
        System.out.println("Preferences:");
        for (Map.Entry<String, ?> pair : prefs.getAll().entrySet()) {
            System.out.println("    " + pair.getKey() + " -> " + pair.getValue());
        }
        System.out.println();
    }

}




Java Source Code List

fi.iki.dezgeg.matkakorttiwidget.gui.AboutAppActivity.java
fi.iki.dezgeg.matkakorttiwidget.gui.HomescreenWidgetProvider.java
fi.iki.dezgeg.matkakorttiwidget.gui.MatkakorttiWidgetApp.java
fi.iki.dezgeg.matkakorttiwidget.gui.SettingsActivity.java
fi.iki.dezgeg.matkakorttiwidget.gui.Utils.java
fi.iki.dezgeg.matkakorttiwidget.gui.WidgetUpdaterService.java
fi.iki.dezgeg.matkakorttiwidget.matkakortti.Card.java
fi.iki.dezgeg.matkakorttiwidget.matkakortti.MatkakorttiApi.java
fi.iki.dezgeg.matkakorttiwidget.matkakortti.MatkakorttiException.java
fi.iki.dezgeg.matkakorttiwidget.matkakortti.NonverifyingSSLSocketFactory.java