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());
        }
    });

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents