Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String PHONE = "phone"; public static final String SETTINGS = "settings"; public static void savePhone(Context context, String phone) { SharedPreferences preferences = context.getSharedPreferences(SETTINGS, Context.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putString(PHONE, phone); editor.apply(); } }