dimanche 3 mai 2015

Make a POST call every 10 seconds for an infinite time?

How can I make a certain function executed after every 10 seconds for an infinite time?

What I have done till now: I am getting the location values of the user from the App and storing it on the server. I am using a service, so that, the code keeps running for an infinite time, I am using a Broadcast receiver, so that, if the phone is booted, the service should start again and starts sending me the location.

The issue Everything works perfectly fine for about first 10-15 minutes, but, after this, the service gets stopped itself. Also, when the user signs up for the App, authorized tokens are generated. These tokens are also sent in the POST call as one of the parameters, for security purpose. Even these tokens are lost, despite working perfectly fine for the initial 10 minutes. I am storing these tokens in SharedPreferences. Any help in this regard would be highly appreciated.

Aucun commentaire:

Enregistrer un commentaire