I have a function save() which will send some data to server periodically after 15 minute. How can I achieve this function in service class. I have heard about alarm manager & handlers but does not know any implementation of those.
I have a function save() which will send some data to server periodically after
Share
A high level overview. You need:
Take a look at
IntentServiceas it will simplify some things for you. Assuming your implementation forsave()is fairly isolated, you can pretty much just call it inonHandleIntent. Additionally, here is the documentation forAlarmManager, which you will need to set a repeating alarm. You give an alarm anIntentto fire. In this case, theIntentshould point to yourIntentService.