android play-services (9.8.0) の最新の変更により、それが可能になるはずです。
1.Fitness.GOALS_API を GoogleAPIClient に追加します。
googleApiClient = new GoogleApiClient.Builder(CrossoverWatchFaceService.this)
.addConnectionCallbacks([...])
.addApi(Fitness.HISTORY_API)
.addApi(Fitness.GOALS_API)
.useDefaultAccount()
.build();
googleApiClient.connect();
2.目標を取得する
PendingResult<GoalsResult> pendingResult =
Fitness.GoalsApi.readCurrentGoals(
googleApiClient,
new GoalsReadRequest.Builder()
.addDataType(DataType.TYPE_STEP_COUNT_DELTA)
.build());
pendingResult.setResultCallback(
new ResultCallbacks<GoalsResult>() {
@Override
public void onSuccess(@NonNull GoalsResult goalsResult) {
List<Goal> goals = goalsResult.getGoals();
//YOUR CODE HERE
}
@Override
public void onFailure(@NonNull Status status) {
Log.d(TAG, "onFailure: ");
}
});
https://developers.google.com/fit/android/using-goals
と
https://developers.google.com/android/reference/com/google/android/gms/fitness/GoalsApi