user1320990
user1320990

Reputation:

Dynamic android status bar notification

I`ve an app that use sqlite for storage. In this database I have a table with multiple records that has datetime field. I want to always push a status bar notification 12 hours before of each.

I took a look at http://developer.android.com/guide/topics/ui/notifiers/notifications.html and understand how to use it, but don`t know how to run it periodically in background.

Any tips?

Upvotes: 0

Views: 1435

Answers (1)

mikołak
mikołak

Reputation: 9705

As the linked documentation mentions, you can create notifications from a local Service. The first example actually describes how to use one for creating and managing notifications.

Additionally, the AlarmManager class might help you with an efficient implementation of said Service. I'd recommend to pay special attention to the notes regarding the phone's sleep cycle and wake locks.

Finally, you might want your Service to start on boot. See this question for details.

Upvotes: 1

Related Questions