We would like to know how to schedual alarm in an hour.
//from w ww.j ava2 s .c o m import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; class AlarmUtils { public static int scheduleInHours(Context context, PendingIntent pi, int hours) { int period = hours * 60 * 60 * 1000; // in millis AlarmManager mgr = (AlarmManager) context .getSystemService(Context.ALARM_SERVICE); long alarmTime = System.currentTimeMillis() + period; mgr.set(AlarmManager.RTC_WAKEUP, alarmTime, pi); return period; } }