-
StackOverflow 文件
-
Android 教程
-
Google Awareness API
-
使用 Snapshot API 獲取當前位置
// Remember to intialize your client as described in the Remarks section
Awareness.SnapshotApi.getLocation(client)
.setResultCallback(new ResultCallback<LocationResult>() {
@Override
public void onResult(@NonNull LocationResult locationResult) {
Location location = locationResult.getLocation();
Log.i(getClass().getSimpleName(), "Coordinates: "location.getLatitude() + "," +
location.getLongitude() + ", radius : " + location.getAccuracy());
}
});