Back to project page Common-Alerting-Protocol-Compliant-Emergency-Warning-App-For-Android-Using-AMQP.
The source code is released under:
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...
If you think the Android project Common-Alerting-Protocol-Compliant-Emergency-Warning-App-For-Android-Using-AMQP listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package in.ac.iitd.cse.iuatc.ews; // w ww.ja v a 2 s .co m import java.util.Calendar; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.util.Log; public class AlermSetter { private static final long intervalInMillis = 10 * 1000; public static void setAlerm(Context context) { AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE); Intent i = new Intent(context, SendLocationUpdateService.class); PendingIntent pi = PendingIntent.getService(context, 0, i, 0); Calendar cal = Calendar.getInstance(); cal.add(Calendar.SECOND, 10); am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), intervalInMillis, pi); Log.d("SendLocationUpdateService","Alerm set"); } }