Statistics
| Branch: | Revision:

root / src / com / rackspacecloud / android / Preferences.java @ 038ac9a4

History | View | Annotate | Download (1.7 kB)

1
package com.rackspacecloud.android;
2

    
3
import android.os.Bundle;
4
import android.preference.PreferenceActivity;
5

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

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

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

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

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

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

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

    
34
        protected void onCreate(Bundle savedInstanceState) {
35
                super.onCreate(savedInstanceState);
36
                getPreferenceManager()
37
                                .setSharedPreferencesName(SHARED_PREFERENCES_NAME);
38
                addPreferencesFromResource(R.layout.preferences);
39
        }
40
}