Statistics
| Branch: | Revision:

root / src / com / rackspace / cloud / android / Preferences.java @ 7dbfc514

History | View | Annotate | Download (2 kB)

1
package com.rackspace.cloud.android;
2

    
3
import android.os.Bundle;
4
import android.preference.PreferenceActivity;
5
import com.rackspace.cloud.android.R;
6

    
7
public class Preferences extends PreferenceActivity {
8
        // The name of the SharedPreferences file we'll store preferences in.
9
        public static final String SHARED_PREFERENCES_NAME = "Preferences";
10

    
11
        // The key to the preference for the type of results to show (us/uk).
12
        // Identical to the value specified in res/values/strings.xml.
13
        public static final String PREF_KEY_RESULTS_TYPE = "countries_type";
14

    
15
        // The key to the Auth Server preference.
16
        public static final String PREF_KEY_AUTH_SERVER = "authServerPref";
17

    
18
        // The key to the application passcode hash.
19
        public static final String PREF_KEY_PASSCODE_HASH = "passcode";
20

    
21
        // the key to the Password on/off preference.
22
        public static final String PREF_KEY_PASSWORD_LOCK = "hasPassword";
23

    
24
        // The values of the preferences for the type of results to show (us/uk).
25
        // Identical to the values specified in res/values/strings.xml.
26
        public static final int COUNTRY_US = 0;
27
        public static final int COUNTRY_UK = 1;
28

    
29
        // Define auth server here
30
        public static final String COUNTRY_US_AUTH_SERVER = "https://auth.api.rackspacecloud.com/v1.0";
31
        public static final String COUNTRY_UK_AUTH_SERVER = "https://lon.auth.api.rackspacecloud.com/v1.0";
32
        public static final String COUNTRY_US_AUTH_SERVER_V2 = "https://auth.api.rackspacecloud.com/v2.0";
33
    public static final String COUNTRY_UK_AUTH_SERVER_V2 = "https://lon.auth.api.rackspacecloud.com/v2.0";
34
        public static final String PITHOS_SERVER = "https://plus.pithos.grnet.gr/v1";
35
        public static final String PITHOS_DEV_SERVER = "https://pithos.dev.grnet.gr/v1";
36

    
37
        //Regions
38
    public static final String[] US_REGIONS = {"ORD", "DFW"};
39
    public static final String[] UK_REGIONS = {"LON"};
40

    
41
        protected void onCreate(Bundle savedInstanceState) {
42
                super.onCreate(savedInstanceState);
43
                getPreferenceManager()
44
                                .setSharedPreferencesName(SHARED_PREFERENCES_NAME);
45
                addPreferencesFromResource(R.layout.preferences);
46
        }
47
}