Skip to content Skip to sidebar Skip to footer

Sms Scheduling In Android

I want to make an SMS scheduling app, that sends SMS at predefined time. I have decided to use a timer for that purpose. During my research, I found out that Alarm Manager was more

Solution 1:

this is what I have for you:

http://mobile.tutsplus.com/tutorials/android/android-fundamentals-scheduling-recurring-tasks/

Edit: How to trigger a broadcast via the AlarmManager:

IntentbroadCastIntent=newIntent(this, "YOURBROADCASTRECEIVER.class");
PendingIntentintent=PendingIntentpendingIntent= PendingIntent.getBroadcast(
                this, 0, intent, 0);
AlarmManageralarmManager= (AlarmManager) getSystemService(ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
                System.currentTimeMillis(),
                AlarmManager.INTERVAL_HOUR, pendingIntent);

Note that this alarm will set off immediately the first time. If you want to set it of later you can multiply "System.currentTimeMillis() * x" where x = 1000 would mean one second.

Post a Comment for "Sms Scheduling In Android"