root / src / com / rackspacecloud / android / Preferences.java @ 48601850
History | View | Annotate | Download (1.9 kB)
1 |
package com.rackspacecloud.android; |
---|---|
2 |
|
3 |
import android.os.Bundle; |
4 |
import android.preference.PreferenceActivity; |
5 |
|
6 |
import com.rackspace.cloud.android.R; |
7 |
|
8 |
public class Preferences extends PreferenceActivity{ |
9 |
// The name of the SharedPreferences file we'll store preferences in.
|
10 |
public static final String SHARED_PREFERENCES_NAME = "Preferences"; |
11 |
|
12 |
// The key to the preference for the type of results to show (us/uk).
|
13 |
// Identical to the value specified in res/values/strings.xml.
|
14 |
public static final String PREF_KEY_RESULTS_TYPE = "countries_type"; |
15 |
|
16 |
// The key to the Auth Server preference.
|
17 |
public static final String PREF_KEY_AUTH_SERVER = "authServerPref"; |
18 |
|
19 |
// The key to the application passcode hash.
|
20 |
public static final String PREF_KEY_PASSCODE_HASH = "passcode"; |
21 |
|
22 |
//the key to the Password on/off preference.
|
23 |
public static final String PREF_KEY_PASSWORD_LOCK = "hasPassword"; |
24 |
|
25 |
// The values of the preferences for the type of results to show (us/uk).
|
26 |
// Identical to the values specified in res/values/strings.xml.
|
27 |
public static final int COUNTRY_US = 0; |
28 |
public static final int COUNTRY_UK = 1; |
29 |
|
30 |
//Define auth server here
|
31 |
public static final String COUNTRY_US_AUTH_SERVER = "https://auth.api.rackspacecloud.com/v1.0"; |
32 |
public static final String COUNTRY_UK_AUTH_SERVER = "https://lon.auth.api.rackspacecloud.com/v1.0"; |
33 |
public static final String COUNTRY_US_AUTH_SERVER_V2 = "https://auth.api.rackspacecloud.com/v2.0"; |
34 |
public static final String COUNTRY_UK_AUTH_SERVER_V2 = "https://lon.auth.api.rackspacecloud.com/v2.0"; |
35 |
|
36 |
//Regions
|
37 |
public static final String[] US_REGIONS = {"ORD", "DFW"}; |
38 |
public static final String[] UK_REGIONS = {"LON"}; |
39 |
|
40 |
protected void onCreate(Bundle savedInstanceState) { |
41 |
super.onCreate(savedInstanceState);
|
42 |
getPreferenceManager().setSharedPreferencesName(SHARED_PREFERENCES_NAME); |
43 |
addPreferencesFromResource(R.layout.preferences); |
44 |
} |
45 |
} |