문제

I want to build an application with a concept that I have to perform an action at a given time which is prespecified. That is it is basically like an alarm.

For that , I want to constantly query the timing so that whenever I find that the present HOUR_OF_DAY and MINUTE matches the input, I perform the given action

In Windows phone, there is the concept if a ticker which I used. How to do it in android? It would be great if I could get the code for it.

도움이 되었습니까?

해결책

Complete example to use AlarmManager in Android.

Follow this tutorial, read,understand and implement.


You should not go with a thought to create a self program or service to check the timings each second else it will eat up all the battery the best solution is to use AlarmManager.

다른 팁

Have a look at AlarmManager. It allows you to schedule your application to run at given times

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top