Java tutorial
//package com.java2s; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; public class Main { public static final void Alarm_service(Context ctx, long atTime, Class<?> cls) { ((AlarmManager) ctx.getSystemService(Context.ALARM_SERVICE)).set(AlarmManager.RTC_WAKEUP, atTime, PendingIntent.getService(ctx, 0, new Intent(ctx, cls), 0)); } }