Domanda

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.

È stato utile?

Soluzione

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.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top