Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is the most battery-efficient way of monitoring proximity to a number of locations in Android?
    primarykey
    data
    text
    <p>I have an app which will take some (internet) action every time the user approaches any one of a set of locations (for example, let's say it notifies a server whenever I am near a Starbucks shop, so my coffee habits can be analysed).</p> <p>What's the most battery-efficient (yet reliable and relatively accurate) way of causing the phone to do something whenever it's at a certain location? I don't need perfect location accuracy - within 50m or so is fine.</p> <p>Currently, I set a ProximityAlert for each location with a 100m radius, and have it raise an Intent, which is then served by a Service which runs in the background. The service also includes an Alarm which causes a download every three hours or so.</p> <p>The Service itself doesn't appear to drain any significant amount of battery - the battery is all drained by "Android OS". According to the Android 4.1.2 Battery monitor, Android OS is using 3x as much CPU as a phone without my app, and has "stay awake" on for most of the time.</p> <p>Would changing it to an IntentService make a difference?</p> <p>Would reducing (or increasing) the radius of the alert make a difference?</p> <p>Would converting it to a Geofence (<a href="https://developer.android.com/training/location/geofencing.html" rel="nofollow">https://developer.android.com/training/location/geofencing.html</a>) make much difference?</p> <p>Can I set it to use a cheaper location service unless it thinks it's close to one of the locations (or will it do that automatically?)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload