I want to create a reminder system for my android user. When the user set the reminder and leave a point, I would like my service to cast him a notification when he come back near this point (let's say more than 5 minutes later).
I can create a service which keep on listening gps updates and cast a notification when the distance with the marked point is small开发者_StackOverflower than 100 meters but I am affraid it would empty the battery very fast. Furthermore, I can not really rely on Network Localization accuracy.
Is there a better way to do that ? I have heard that foursquare have just implemented a such system but I do not know if it works
thanks for your help
Add a proximity alert using addProximityAlert()
Sets a proximity alert for the location given by the position (latitude, longitude) and the given radius. When the device detects that it has entered or exited the area surrounding the location, the given PendingIntent will be used to create an Intent to be fired.
As for the battery drain :
In case the screen goes to sleep, checks for proximity alerts happen only once every 4 minutes. This conserves battery life by ensuring that the device isn't perpetually awake.
精彩评论