Android-Geofence-21
Android-Geofence-21 copied to clipboard
QUESTION: why not use simply "LocationServices.getGeofencingClient(this)"
why not are you using simply LocationServices.getGeofencingClient() like official google samples to get current user location?
mGeofencingClient = LocationServices.getGeofencingClient(this);
mGeofencingClient.addGeofences(getGeofencingRequest(), getGeofencePendingIntent())
.addOnCompleteListener(this);
...
https://github.com/googlesamples/android-play-location/blob/master/Geofencing/app/src/main/java/com/google/android/gms/location/sample/geofencing/MainActivity.java#L111
Any special reason?
Best Regards.
Not sure why, probably because two years ago LocationServices.getGeofencingClient() wasn't available. This was the way to do it, it probably changed since then, to be honest I didn't check how it works in lastest APIs.