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 String getLongitude(Context context) { SharedPreferences sp = getSP(context); return sp.getString("longitude", "0"); } private static SharedPreferences getSP(Context context) { return context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE); } }