Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static String SEETING_RUN_SP = "run_count"; private static SharedPreferences preferences = null; private static SharedPreferences getCountSP(Context context) { if (preferences == null) { preferences = context.getSharedPreferences(SEETING_RUN_SP, Context.MODE_PRIVATE); } return preferences; } }