According to the API documentation, only Circular shape Geofences allowed:
https://developers.google.com/android/reference/com/google/android/gms/location/Geofence.Builder
And it's looks for example: https://developer.android.com/training/location/geofencing.html
But I have 4 locations, representing 4 corners of rectangle, and I want my Geofence to be that rectangle.
I want to avoid solution of building my custom location monitoring service extending the functionality of monitoring Geofences, because I think this kind of services are CPU & power consuming...
Thanks,
You have to do it by yourself (however I think it's rather senseless - geofences/location services are inaccurate enough to not even be able to alert about circles, don't even think about some other concrete shape).
Create smallest circular geofence which contains your polygon and if triggered just check if you are in the polygon inside with Google Maps Android API utility library.
In other words check if you are in white area not in grey:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With