summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/ConfigHelper.java
blob: b2baed678ae3f9765e7554afc49beaf7b395811f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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 cert_key = "cert";
	final static String eip_service_key = "eip";

	static void saveSharedPref(String shared_preferences_key, JSONObject content) {

		SharedPreferences.Editor shared_preferences_editor = ConfigurationWizard.shared_preferences
				.edit();
		shared_preferences_editor.putString(shared_preferences_key,
				content.toString());
		shared_preferences_editor.commit();
		System.out.println("Shared preferences updated: key = "
				+ shared_preferences_key
				+ " Content = "
				+ ConfigurationWizard.shared_preferences.getString(
						shared_preferences_key, "Default"));
	}
	
	static void rescueJSONException(JSONException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}