简体   繁体   中英

How to schedule 3 events to notify user via (notification bar) in android which runs even when my app is not running

i have designed a news app where in i have to alert the user at 3 times in a day selected by the user.

The alert is done via android notification which i can code but i am not able to figure out how to schedule those 3 tasks and note this should alert user even when user is not running my app

Thank you

You need to use the AlarmManager for precise time events, or JobSchedulers when timing is not that important. For the alarmmanager, use this tutorial: http://www.vogella.com/tutorials/AndroidTaskScheduling/article.html

And for the in-app notifications do this: http://www.vogella.com/tutorials/AndroidNotifications/article.html

This is guarantied to work. Any question send me a private message. Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM