Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7491239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:56:47+00:00 2026-05-29T15:56:47+00:00

I want to make an SMS scheduling app, that sends SMS at predefined time.

  • 0

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 appropriate option for scheduling one time events in android. Any guidance would be fruitful.

I want to implement the timer in my service as shown in the give code:

public class SMSTimerService extends Service {

private Timer timer = new Timer();

Long delay = 10000L;//for long we have to keep L at the last of the integer;

@Override
public IBinder onBind(Intent intent) {
    // TODO Auto-generated method stub
    return null;//null means we are not using any IPC here
}

@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();
    Log.i("prativa","service has started");
    startService();

}
@Override
public void onDestroy() {

    super.onDestroy();
    Log.i("prativa","service is destroying");
    shutdownService();
}
/*
 * starting the service
 * */
private void startService()
{
    TimerTask task = new TimerTask(){

        @Override
        public void run() {
            sendSMS();

        }};
    timer.schedule(task, delay);
}
private void sendSMS()
{
    String phone = "5556";
    String message = "This is my test message";

    SmsManager sms = SmsManager.getDefault();
    sms.sendTextMessage(phone, null, message, null, null);



}
private void shutdownService()
{
    if(timer != null)
        timer.cancel();
    Log.i("Prativa","Timer has stopped");

}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:56:48+00:00Added an answer on May 29, 2026 at 3:56 pm

    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:

    Intent broadCastIntent = new Intent(this, "YOURBROADCASTRECEIVER.class");
    PendingIntent intent = PendingIntent pendingIntent = PendingIntent.getBroadcast(
                    this, 0, intent, 0);
    AlarmManager alarmManager = (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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a SMS gateway app, that polls my website and checks
I want make an iphone app that has a UITableView that displays different texts
I want to make a desktop application that can read the SMS from the
I want to make an application that can send an SMS to person in
I have style sheet with a class name changebackgroundcolor i want make change in
I want to make an etag that matches what Apache produces. How does apache
I want to make a table in SqlServer that will add, on insert, a
I want to make an entity that has an autogenerated primary key, but also
i want to make an application in which ,if user is sending sms through
i want make function like that function(data){ } i want this data as this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.