@@ -0,0 +1,2406 @@
+package com.fyp.mountainRescue2;%0A%0A%0A%0A%0A%0A%0Aimport android.content.Context;%0Aimport android.content.SharedPreferences;%0Aimport android.content.SharedPreferences.*;%0Aimport android.os.Bundle;%0Aimport android.preference.CheckBoxPreference;%0Aimport android.preference.ListPreference;%0Aimport android.preference.Preference;%0Aimport android.preference.PreferenceActivity;%0Aimport android.preference.PreferenceManager;%0Aimport android.util.Log;%0A//This file is used to store configured details for locationActivity%0Apublic class Preferences extends PreferenceActivity implements OnSharedPreferenceChangeListener%7B%0A%0A%09public static final String situation =%22list_preference%22;%0A%09public static final String compass = %22checkbox_preference%22;%0A%09%0A%09private CheckBoxPreference checkPreference;%0A%09private ListPreference listPreference;%0A    @Override%0A    protected void onCreate(Bundle savedInstanceState) %7B%0A        super.onCreate(savedInstanceState);%0A        %0A        // Load the preferences from an XML resource%0A        addPreferencesFromResource(R.xml.setting);%0A        %0A        Context context = getApplicationContext();%0A        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);%0A        preferences.registerOnSharedPreferenceChangeListener(this);%0A        checkPreference =(CheckBoxPreference)getPreferenceScreen().findPreference(compass);%0A        listPreference =(ListPreference)getPreferenceScreen().findPreference(situation);%0A    %7D%0A    %0A    @Override%0A    protected void onResume()%0A    %7B%0A    %09%0A    %09//checkPreference.setSummary(sharedPreferences.getBoolean(%22compass%22,true));%0A    %7D%0A    @Override%0A    protected void onPause()%0A    %7B%0A    %09%0A    %7D%0A    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key)%0A    %7B%0A    %09Log.i(%22Preferences%22, %22Preferences changed, key =%22+key);%0A    %09if(key.equals(compass))%0A    %09%7B%0A    %09%09//checkPreference.setSummary(sharedPreferences.getBoolean(compass,false))%0A    %09%09%0A    %09%7D%0A    %7D%0A    public static boolean getCompass(Context context)%0A    %7B%0A    %09//This sees whether the compass has been enable or disabled%0A    %09return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(%22compass%22,true);%0A    %09%0A    %7D%0A    %0A    public static boolean getMyLocation(Context context)%0A    %7B%0A    %09//This sees whether the map view has been enable or disabled%0A    %09return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(%22map%22,true);%0A    %7D%0A%0A%7D%0A

Create Preferences.java