I checked almost all questions in stack overflow and also in google documentation and still couldn't understand what to use exactly for my cases.
What i want is, user will select reminder date in the app and in that time app will send a notification even app is closed or phone restarted between remind set time and remind time.
So what do i need to use? Which classes do i need? Broadcast Receiver, AlarmManager these two is enough or what? a sample of code 20-30 lines would be nice =)
You will need both a few things.
Setup: You need to set your app to listen for the phone starting by registering for this intent in your manifest.
Basically you when your user selects the time, you will need to:
If your app ever gets the broadcast that the phone was rebooted, then all of your alarms are lost. You need to reset them using the times you saved in the file/db/shared prefs.