Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static final String SP_NAME = "login_data"; public static long getRegionID(Context context) { SharedPreferences sp = getSP(context); return sp.getLong("currentRegionID", 510100); } private static SharedPreferences getSP(Context context) { return context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE); } }