Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.content.SharedPreferences; public class Main { public static void saveDate(Context context) { SharedPreferences sp = context.getSharedPreferences("upushlog_time", Context.MODE_PRIVATE); if (0 == sp.getLong("time", 0)) { sp.edit().putLong("time", System.currentTimeMillis()).commit(); } } }