Java tutorial
//package com.java2s; import android.content.Context; import android.content.SharedPreferences; public class Main { public static final String PREFS_CACHE_ONE = "prefs_cache_one"; public static void setNonWiFiTime(long time, Context context) { SharedPreferences sp = context.getSharedPreferences(PREFS_CACHE_ONE, 0); SharedPreferences.Editor editor = sp.edit(); editor.putLong("nonWiFiTime", time); editor.commit(); } }