Get current location using Snapshot API
suggest change// Remember to initialize your client as described in the Remarks section
Awareness.SnapshotApi.getLocation(client)
.setResultCallback(new ResultCallback<LocationResult>() {
@Override
public void onResult(@NonNull LocationResult locationResult) {
if (!locationResult.getStatus().isSuccess()) {
Log.e(getClass().getSimpleName(), "Could not get the current location.");
return;
}
Location location = locationResult.getLocation();
Log.i(getClass().getSimpleName(), "Coordinates: " + location.getLatitude() + "," +
location.getLongitude() + ", radius : " + location.getAccuracy());
}
});
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents