diff options
author | Parménides GV <parmegv@sdf.org> | 2013-02-04 16:35:28 +0100 |
---|---|---|
committer | Parménides GV <parmegv@sdf.org> | 2013-02-04 16:35:28 +0100 |
commit | d2bd18ef560d95974117604af899b3a9fcc16dab (patch) | |
tree | 96831726c943bcccb104584d4748c5972a43654e /src/se/leap/leapclient/ConfigHelper.java | |
parent | 7b9e22e765a1e5eda05ad121684e63c20ff5f049 (diff) |
Created ConfigHelper with static information such as sharedprefs keys,
the saveSharedPrefs method and an unimplemented rescueFromJSONException.
Next step: managing HttpsURLConnection for the
CertPathValidatorException.
Diffstat (limited to 'src/se/leap/leapclient/ConfigHelper.java')
-rw-r--r-- | src/se/leap/leapclient/ConfigHelper.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/se/leap/leapclient/ConfigHelper.java b/src/se/leap/leapclient/ConfigHelper.java new file mode 100644 index 00000000..174ff79f --- /dev/null +++ b/src/se/leap/leapclient/ConfigHelper.java @@ -0,0 +1,32 @@ +package se.leap.leapclient; + +import org.json.JSONException; +import org.json.JSONObject; + +import android.content.SharedPreferences; + +public class ConfigHelper { + + final static String downloadJsonFilesBundleExtra = "downloadJSONFiles"; + final static String provider_key = "provider"; + final static String eip_service_key = "eip"; + + static void saveSharedPref(String shared_preferences_key, + JSONObject content) { + + SharedPreferences.Editor shared_preferences_editor = ProviderListActivity.shared_preferences + .edit(); + shared_preferences_editor.putString(shared_preferences_key, + content.toString()); + shared_preferences_editor.commit(); + System.out.println("Shared preferences updated: " + + ProviderListActivity.shared_preferences.getString( + shared_preferences_key, "Default")); + + } + + static void rescueJSONException(JSONException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } +} |