// Path: AccGeofences/app/src/main/java/com/accengage/samples/geofences/activities/DBPreferencesActivity.java
// public class DBPreferencesActivity extends Activity {
// 
//     public static final String KEY_PREFERENCE_ID = "key_preference_id";
//     public static final String DBVIEW_PREFERENCES_FILE_NAME = BuildConfig.APPLICATION_ID + ".dbview_preferences";
// 
//     public static final int GEOFENCE_PREFERENCES = 0;
// 
//     @TargetApi(Build.VERSION_CODES.HONEYCOMB)
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         int preferenceId = getIntent().getIntExtra(KEY_PREFERENCE_ID, GEOFENCE_PREFERENCES);
//         if (preferenceId == GEOFENCE_PREFERENCES) {
//             // Display geofence preferences fragment
//             getFragmentManager().beginTransaction()
//                     .replace(android.R.id.content, new GeofencePreferencesFragment())
//                     .commit();
//         }
//     }
// 
// 
//     @TargetApi(Build.VERSION_CODES.HONEYCOMB)
//     public static class GeofencePreferencesFragment extends PreferenceFragment {
// 
//         @Override
//         public void onCreate(Bundle savedInstanceState) {
//             super.onCreate(savedInstanceState);
// 
//             //PreferenceManager.setDefaultValues(getActivity(), R.xml.geofence_dbview_settings, false);
//             getPreferenceManager().setSharedPreferencesName(DBVIEW_PREFERENCES_FILE_NAME);
// 
//             addPreferencesFromResource(R.xml.geofence_dbview_settings);
//         }
//     }
// }


import android.content.Context;
import android.content.SharedPreferences;
import com.accengage.samples.geofences.activities.DBPreferencesActivity;
import com.google.android.gms.maps.model.Circle;
package com.accengage.samples.geofences;



public class Utils {

    public static int _ID = 0;
    public static int SERVER_ID = 1;
    public static int EXTERNAL_ID = 2;
    public static int NAME = 3;
    public static int LATITUDE = 4;
    public static int LONGITUDE = 5;
    public static int RADIUS = 6;
    public static int DETECTED_TIME = 7;
    public static int NOTIFIED_TIME = 8;
    public static int DETECTED_COUNT = 9;
    public static int DEVICE_LATITUDE = 10;
    public static int DEVICE_LONGITUDE = 11;
    public static int DISTANCE = 12;

    /**
     * Checks in the SharedPreferences how you chose the geofences to be displayed
     * @param context
     * @return selected option as a keyword
     */
    public static String getGeofenceSortingField(Context context) {
        SharedPreferences preferences = context.getSharedPreferences(
// Path: AccGeofences/app/src/main/java/com/accengage/samples/geofences/activities/DBPreferencesActivity.java
// public class DBPreferencesActivity extends Activity {
// 
//     public static final String KEY_PREFERENCE_ID = "key_preference_id";
//     public static final String DBVIEW_PREFERENCES_FILE_NAME = BuildConfig.APPLICATION_ID + ".dbview_preferences";
// 
//     public static final int GEOFENCE_PREFERENCES = 0;
// 
//     @TargetApi(Build.VERSION_CODES.HONEYCOMB)
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         int preferenceId = getIntent().getIntExtra(KEY_PREFERENCE_ID, GEOFENCE_PREFERENCES);
//         if (preferenceId == GEOFENCE_PREFERENCES) {
//             // Display geofence preferences fragment
//             getFragmentManager().beginTransaction()
//                     .replace(android.R.id.content, new GeofencePreferencesFragment())
//                     .commit();
//         }
//     }
// 
// 
//     @TargetApi(Build.VERSION_CODES.HONEYCOMB)
//     public static class GeofencePreferencesFragment extends PreferenceFragment {
// 
//         @Override
//         public void onCreate(Bundle savedInstanceState) {
//             super.onCreate(savedInstanceState);
// 
//             //PreferenceManager.setDefaultValues(getActivity(), R.xml.geofence_dbview_settings, false);
//             getPreferenceManager().setSharedPreferencesName(DBVIEW_PREFERENCES_FILE_NAME);
// 
//             addPreferencesFromResource(R.xml.geofence_dbview_settings);
//         }
//     }
// }


// Path: AccGeofences/app/src/main/java/com/accengage/samples/geofences/Utils.java
import android.content.Context;
import android.content.SharedPreferences;
import com.accengage.samples.geofences.activities.DBPreferencesActivity;
import com.google.android.gms.maps.model.Circle;

package com.accengage.samples.geofences;



public class Utils {

    public static int _ID = 0;
    public static int SERVER_ID = 1;
    public static int EXTERNAL_ID = 2;
    public static int NAME = 3;
    public static int LATITUDE = 4;
    public static int LONGITUDE = 5;
    public static int RADIUS = 6;
    public static int DETECTED_TIME = 7;
    public static int NOTIFIED_TIME = 8;
    public static int DETECTED_COUNT = 9;
    public static int DEVICE_LATITUDE = 10;
    public static int DEVICE_LONGITUDE = 11;
    public static int DISTANCE = 12;

    /**
     * Checks in the SharedPreferences how you chose the geofences to be displayed
     * @param context
     * @return selected option as a keyword
     */
    public static String getGeofenceSortingField(Context context) {
        SharedPreferences preferences = context.getSharedPreferences(
                DBPreferencesActivity.DBVIEW_PREFERENCES_FILE_NAME,