Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        public static void saveRecords(Android.Content.ISharedPreferences sp)
        {
            string jstring = JsonConvert.SerializeObject(myRecords);
            var    editor  = sp.Edit();

            editor.PutString("records", jstring);
            editor.Commit();
        }
Esempio n. 3
0
        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();
        }
Esempio n. 4
0
 /// <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);
 }