Search code examples
androidgeofencingandroid-geofencegoogle-geolocation

Android Geofencing: Trigger only while outside geofence


I am making a geofencing application, which must trigger notification constantly while the device is outside the geofence, not only on exit.

I have tried using Geofencing API through the training example given in Google android developer training page. But, I got notification only when the device enters, dwell or exit.

According to what I have researched till now in both SO and google, there are only three types of transitions handled in Geofencing API: Enter, Dwell and Exit. And the notification starts only when device enters the geofence, till it exits.

Can anyone help me out how to make it work?


Solution

  • That is not possible that way. It does not make any sense outside the geofence area. That is not an usecase of geofence.

    You can try to specify broader range of the area and then check the geocoordinates if this is outside of your area you want to have.