Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { private static SharedPreferences sOAuthCredentials; /** * TODO: call this in your Application onCreate() to initialize a SharedPref object * * @param context your Application Context */ public static void initSharedPref(Context context) { sOAuthCredentials = context.getSharedPreferences("oauth", Context.MODE_PRIVATE); } }