Following Code is written into the Shared Project.
Imported Packages
using Android.Content;
using Android.Preferences;
For Storing the value into the Shared Preference
ISharedPreferences pref = PreferenceManager.GetSharedPreferences("UserInfo", FileCreationMode.Private);
ISharedPreferencesEditor edit = pref.Edit();
edit.PutString("Username", username.Text.Trim());
edit.PutString("Password", password.Text.Trim());
edit.Apply();
For Retrieve the value
ISharedPreferences pref = PreferenceManager.GetSharedPreferences("UserInfo", FileCreationMode.Private);
string userName = pref.GetString("Username", String.Empty);
string password = pref.GetString("Password", String.Empty);
We Got following Error
'Android.Preferences.PreferenceManager' does not contain a definition for 'GetSharedPreferences'
How to use the Shared Preference into Xamarin Forms.?