I\'m looking for best techniques for Location Aware notifications.
My first try was to use LocationManager\'s addProximityAlert but it requires ACCESS_FINE_LOCATION (COA
I built such an app (hence my question in the Office Hours Q&A about how to measure the power draw of the LocationManager) and meanwhile it's working really well. I initially intended to use the builtin proximity alert, but struggled over the same issue as you and thought that it's not flexible enough.
Instead, I built a service which uses the LocationProvider to poll the location every five minutes using the NETWORK_PROVIDER, calculates the distance to the desired location(s) and if within proximity, fires a notification. In cities with lots of Wifi networks, this gives me an (reported) accuracy of 50 meters.
I also use the PASSIVE_PROVIDER to benefit from other apps' location requests.
If I'm nearby a desired location and the reported accuracy is too coarse to decide whether I'm within the specified proximity range or not, I'm using single GPS location requests as backup. I also use single GPS location requests if the NETWORK_PROVIDER times out. To not have the GPS provider drain the battery while I'm using the subway, it also has a timeout with exponential backoff.
While I'm connected to a Wifi network, I assume that I'm not moving, and disable the location providers during that time.
The last change I made was to use a 15 minute ("inexact repeating") timer for the NETWORK_PROVIDER if I can determine that I will not be able make it to any of the saved locations within 15 minutes (so polling with a 5 minute intervall doesn't make sense). This helps saving power.
I was thinking about using an even longer interval to save even more power, but it's not easy to find a heuristic here that determines whether I would be able to reach one of my saved locations within that time or not, because I can not always assume the same traveling speed (walking, traveling by train or car). But as I'm not able to measure the power draw of the LocationManager caused by my app, I don't know how to evaluate the power comsumption in an every day scenario.
I wouldn't mind if the builtin API would provide all that logic, but I concluded that it does not, so I built this on my own.
Hope this helps you.