I have developed an application that needs to display daily steps count. To do this, I used the API available in Google Fit SDK.
All seems to be working properly, bu
Google Play Services 7.3 (released 4/28/2015) added a new method to the HistoryApi.readDailyTotal, which matches the step count on Google Fit official app and is easier to use.
PendingResult result = Fitness.HistoryApi.readDailyTotal(fitnessApiClient, DataType.AGGREGATE_STEP_COUNT_DELTA);
DailyTotalResult totalResult = result.await(30, TimeUnit.SECONDS);
if (totalResult.getStatus().isSuccess()) {
DataSet totalSet = totalResult.getTotal();
steps = totalSet.isEmpty() ? -1 : totalSet.getDataPoints().get(0).getValue(Field.FIELD_STEPS).asInt();
}