I am not sure if this is a bug with the new Android GeoFence sample code or my understanding of what it is supposed to do is wrong. The sample app creates geofences but does not alert when geofence is breached. If anyone would like to give this a try and confirm, you can download the sample code from here :
https://developer.android.com/training/location/geofencing.html
This is what I was expecting the sample app to do :
- Setup 2 different geofences. In my case, I picked 2 points a mile apart by entering their respective lat/long. I also set the radius to 250m .
- I drove to each of those 2 locations one after another and I assumed a notification would popup indicating that the geofence has been breached.
In this case, no notifications nor any log messages were registered which means that "ReceiveTransitionsIntentService" never got called. One observation is that when I drive to the first location and then add a new geofence right at that location, the notification gets fired immediately, but any other location (geofence) I set and drive to, nothing happens.
Any idea why? Is my understanding correct about the sample app's functionality?
Do I need to do anything in addition to what is in the sample code to receive an alert when I breach the geofence while driving? Is geofence monitoring separate from creating geofences, what am I missing here?
Highly appreciate any input, We are very eager to use this in our app but right now we are stuck.
Thanks, Torri.
Geofencing Api
rarely use GPS. I think it's useless to implement it. – Radley