1. couvertfo's Avatar
    I am implementing a solution to track location updates in my Application,both in foreground and background, and perform some task when location is updated.

    As per the Google recommendations in https://developers.google.com/androi...PendingIntent), I used PendingIntent variant of requestLocationUpdates API.

    What is the best way to perform a task when location is changed ?

    As per the Google sample https://github.com/googlesamples/and...PendingIntent/tellthebell, task to be performed when location changes, is done in the onReceive() of broadcast receiver. This approach doesn't deal with wakelocks and the device background restrictions.

    As per my understanding after going through various stackoverflow answers and different blogs, I have to use JobIntentService.

    • Is using JobIntentService is the correct approach for my requirement
    • Do Application needs to acquire wakelock to perform a task when location changes, when device is in sleep mode(I am aware that JobIntentService automatically handles wakelocks).
    • When the system callbacks like onlocationChanged(),onReceive() of BroadcastReceiver() are invoked, is CPU awaked automatically when device is in sleepmode. If waked, how much time it will be active ? Does it wait for callback to be finished.
    05-20-2020 05:58 AM
  2. B. Diddy's Avatar
    Welcome to Android Central! FYI, I moved this from the General Help forum to the Software Development forum for more specific traffic.
    05-20-2020 09:24 PM

Similar Threads

  1. Replies: 1
    Last Post: 05-31-2020, 10:31 PM
  2. Power and volume down button not working.
    By Android Central Question in forum Ask a Question
    Replies: 2
    Last Post: 05-20-2020, 11:06 PM
  3. Replies: 4
    Last Post: 05-20-2020, 09:30 PM
  4. Changing sd memory card and cloud storage
    By Harinder Dhillon in forum General Help and How To
    Replies: 1
    Last Post: 05-19-2020, 04:38 PM
  5. Replies: 1
    Last Post: 09-30-2016, 08:15 PM