Hi, jmpessoa.
1. Can you adapt below java code or improved related function to the Android Module Wizard in the fashion GetIntData, SetIntData, GetStringData, SetStringData, GetBoolData, SetBoolData?
2. Can you add GPS component to the Android Module Wizard?
Thanks.
private static int getIntData(Context context, String Key, int defValue) {
SharedPreferences sPref = PreferenceManager
.getDefaultSharedPreferences(context);
return sPref.getInt(Key, defValue);
}
private static void setIntData(Context context, String Key, int Value) {
SharedPreferences sPref = PreferenceManager
.getDefaultSharedPreferences(context);
SharedPreferences.Editor edt = sPref.edit();
edt.putInt(Key, Value);
edt.commit();
}
private static String getStringData(Context context, String Key, String defValue) {
SharedPreferences sPref = PreferenceManager
.getDefaultSharedPreferences(context);
return sPref.getString(Key, defValue);
}
private static void setStringData(Context context, String Key, String Value) {
SharedPreferences sPref = PreferenceManager
.getDefaultSharedPreferences(context);
SharedPreferences.Editor edt = sPref.edit();
edt.putString(Key, Value);
edt.commit();
}
private static boolean getBoolData(Context context, String Key, boolean defValue) {
SharedPreferences sPref = PreferenceManager
.getDefaultSharedPreferences(context);
return sPref.getBoolean(Key, defValue);
}
private static void setBoolData(Context context, String Key, boolean Value) {
SharedPreferences sPref = PreferenceManager
.getDefaultSharedPreferences(context);
SharedPreferences.Editor edt = sPref.edit();
edt.putBoolean(Key, Value);
edt.commit();
}