I Just build an app to send lat and long data from device to server and i want to store it in database. App is working fine .. But what i need is. I want the app to send the same to the server even if the app is closed. How can i make the app to wake up on every 1 hour. So what changes should i made !
Asked
Active
Viewed 302 times
1
-
You can use AsyncTask to execute any network related task or you can use IntentService for the same . – Rv Lalwani Jan 11 '17 at 09:21
-
Can you explain how ? I'm new to android – Akshay N Shaju Jan 11 '17 at 09:22
-
use this link for example http://www.codexpedia.com/android/asynctask-and-httpurlconnection-sample-in-android/ – Rv Lalwani Jan 11 '17 at 09:26
-
If you want's to know how to use AlarmManager, do follow this. https://developer.android.com/training/scheduling/alarms.html – ImMathan Jan 11 '17 at 09:27
-
You have to use POST method for that so follow this: http://mobiledevtuts.com/android/android-http-with-asynctask-example/ – Rv Lalwani Jan 11 '17 at 09:31
-
Let me try :) Thanks for your help – Akshay N Shaju Jan 11 '17 at 09:36
1 Answers
1
Create a class which extends service and create a thread inside it and start location updates inside the thread. You can use below link for reference which I had answered a year ago. In this you can use thread.

Community
- 1
- 1

Anas Ahamed
- 186
- 10