Android Open Source - WhereIParked Settings Manager






From Project

Back to project page WhereIParked.

License

The source code is released under:

GNU General Public License

If you think the Android project WhereIParked 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

package com.cachirulop.whereiparked.manager;
/*from www  .  ja  va2 s  .  co m*/
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.cachirulop.whereiparked.R;

public class SettingsManager
{
    public static final String KEY_PREF_AUTO_SAVE_POSITION    = "pref_autoSavePosition";
    public static final String KEY_PREF_BLUETOOTH_DEVICE_LIST = "pref_bluetoothDeviceList";
    public static final String KEY_PREF_MAP_FILES_PATH        = "pref_mapFilesPath";
    public static final String KEY_PREF_MAP_MODE              = "pref_mapMode";

    public enum MapModeType
    {
        AUTO,
        ONLINE,
        OFFLINE
    }

    private static SharedPreferences getSharedPrefs ()
    {
        return PreferenceManager.getDefaultSharedPreferences (ContextManager.getContext ());
    }

    public static String getMapFilesPath ()
    {
        return getSharedPrefs ().getString (KEY_PREF_MAP_FILES_PATH,
                                            "");
    }

    public static MapModeType getMapMode ()
    {
        return MapModeType.values () [getMapModeInt ()];
    }

    public static String getMapModeDesc ()
    {
        return ContextManager.getStringFromArray (R.array.pref_mapModeText,
                                                  getMapModeInt ());
    }

    public static int getMapModeInt ()
    {
        String index;

        index = getSharedPrefs ().getString (KEY_PREF_MAP_MODE,
                                             "0");

        return Integer.parseInt (index);
    }

}




Java Source Code List

com.cachirulop.whereiparked.activity.MainActivity.java
com.cachirulop.whereiparked.activity.SettingsActivity.java
com.cachirulop.whereiparked.broadcast.BluetoothBroadcastReceiver.java
com.cachirulop.whereiparked.broadcast.ConnectivityBroadcastReceiver.java
com.cachirulop.whereiparked.common.ErrorDialogFragment.java
com.cachirulop.whereiparked.common.MessageHandler.java
com.cachirulop.whereiparked.common.Message.java
com.cachirulop.whereiparked.common.exception.ConfigurationException.java
com.cachirulop.whereiparked.common.exception.MapsForgeException.java
com.cachirulop.whereiparked.common.exception.WhereIParkedException.java
com.cachirulop.whereiparked.data.WhereIParkedDataHelper.java
com.cachirulop.whereiparked.entity.MapFile.java
com.cachirulop.whereiparked.entity.MapSubfile.java
com.cachirulop.whereiparked.fragment.SettingsFragment.java
com.cachirulop.whereiparked.manager.ContextManager.java
com.cachirulop.whereiparked.manager.IProgressListener.java
com.cachirulop.whereiparked.manager.MapFilesManager.java
com.cachirulop.whereiparked.manager.MapSubfilesManager.java
com.cachirulop.whereiparked.manager.MapsForgeManager.java
com.cachirulop.whereiparked.manager.ProgressDialogListener.java
com.cachirulop.whereiparked.manager.SettingsManager.java
com.cachirulop.whereiparked.preferences.BluetoothDevicePreference.java
com.cachirulop.whereiparked.provider.MapsForgeTileProvider.java
com.cachirulop.whereiparked.provider.TestMapForgeTileProvider.java