Skip to content

Instantly share code, notes, and snippets.

View StringMon's full-sized avatar

Sterling Udell StringMon

View GitHub Profile
private GoogleApiClient stepClient = null;
private float scaledStepCount = 0;
private void countSteps() {
if (stepClient == null) {
stepClient = new GoogleApiClient.Builder(getBaseContext())
.addApi(Fitness.HISTORY_API)
.addApi(Fitness.RECORDING_API)
// When user has multiple accounts, useDefaultAccount() allows Google Fit to
// associated with the main account for steps. It also replaces the need for