Send GPS data to a web service every 10 minutes
Send GPS data to a web service every 10 minutes
Hi im developing a android app that get your current location and send it to a web service even if the user minimize the app , the part of getting the location and connecting with mi WB is working the question is how can send the data every 10 min and how keep sending that data even if the user minimize the app , i had research a little and many ppl say i should use android service or use a timer im really new at android and this is something confusing for me hope u can help me with a example
will JobScheduler work in devices under API 21 ??
– Antonio
Sep 10 '18 at 22:06
Workscheduler, which wraps job scheduler, will
– Gabe Sechan
Sep 10 '18 at 22:17
you can use WorkManager developer.android.com/topic/libraries/architecture/workmanager
– Qasim
Sep 11 '18 at 10:30
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
On modern devices you can't. Doze mode will break that. You can get every 15ish minutes at best. But the right answer for anything periodic is to use JobScheduler to schedule a repeating job, get the data you need, then send it to the server all during the job.
– Gabe Sechan
Sep 10 '18 at 21:44