Have you tried GeoFencing, its really cool. It lets you define a center point, and a radius. Once the user enters this radius you get callback or a pendingIntent. You can do what you want in your callback.
You can get addresses of your customers and build geofence around their locations.
Edit :
If you choose to not use GeoFenceing
(for what ever reason), note that LocationManager
is highly buggy and unstable on most mobile phones (Samsung).
Instead use LocationClient
, which takes care of all the crap LocationManager
leaves with us to deal with and provides location faster, lesser battery and customized accuracy.
Edit :
If anyone tries to convince you otherwise, check this out. A video from google developers and their talk about why LocationManager
sucks, and why they knew and helped us figure out the value Sensors add to the entire solution.
Edit : Design of your solution
You need 2 geofences
1) Outer, you can hard code this to a imaginary 500 m from office. From then on you can start looking for wifizones
2) Once a wifizone is found, save the gps and the distance from his address point. That is your inner radius.
1 Geofence is defined by your install, 2nd geofence is defined by your runtime.
2nd Geofence and be used henceforth to disable GPS (only incase you decide to use LocationManager
). If not you wont need this, LocationClient
will do what it does best.