In My app I want to do some operations on every 3mins, 5mins, 10 mins. In android is there any API
to do it in single Timer/thread. What is the best way to that ?
In My app I want to do some operations on every 3mins, 5mins, 10
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
The proper way to create Timers in Android is to use Handler, as suggested here. You could create one Handler task for every interval you need.
One thing to notice is that if you need long intervals (like 3 or 5 minutes you’ve mentioned), your application may not running for so long. In that a case you can use and AlarmManager.