user2685528
user2685528

Reputation: 3

Automatic messaging android application

I have coded an automatic messaging application in android. It sends messages automatically at a user specified date and time, including repetition and time interval. But the problem I am facing is that since I have used threads for sleeping upto the specified time my app screen goes blank while the threads are in sleeping state. Please suggest how to deal with that???

Upvotes: 0

Views: 74

Answers (1)

JanBo
JanBo

Reputation: 2933

If the app sends messages at user specified time and date, i would suggest using AlarmManager and Service to do the job instead of having Threads that sleep. This way your app doesnt have to be "visibly" running to the user to do the "cron" job.

Upvotes: 1

Related Questions