void Abstraction.DependencyServices.ISharedPreferences.SaveString(string pKey, string pValue) { Android.Content.ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(Xamarin.Forms.Forms.Context); ISharedPreferencesEditor editor = prefs.Edit(); editor.PutString(pKey, pValue); editor.Apply(); }
public static void saveRecords(Android.Content.ISharedPreferences sp) { string jstring = JsonConvert.SerializeObject(myRecords); var editor = sp.Edit(); editor.PutString("records", jstring); editor.Commit(); }
void Abstraction.DependencyServices.ISharedPreferences.RemoveString(string pkey) { Android.Content.ISharedPreferences prefs = PreferenceManager.GetDefaultSharedPreferences(Xamarin.Forms.Forms.Context); ISharedPreferencesEditor editor = prefs.Edit(); editor.Remove(pkey); editor.Apply(); }
/// <summary> /// gets the app preferences object from android /// </summary> /// <returns></returns> public static Android.Content.ISharedPreferences GetAppSharedPrefs() { Prefs = Android.App.Application.Context.GetSharedPreferences("BitChute", FileCreationMode.Private); PrefEditor = Prefs.Edit(); return(Prefs); }