Removed Fitness.API on Google Play Services 7.0?

After switching to Google Play Services 7.0, my GoogleApiClientcode for connecting to Google Fit no longer works: it says:

Error: (87, 21) error: no suitable method was found for addApi (Void) method Builder.addApi (Api, O) is not applicable (cannot create instances from arguments, since the actual and formal lists of arguments differ in length) Builder.addApi method (Api) is not applicable (the actual Void argument cannot be converted to Api by converting a method call) where O is a variable of the type: O extends HasOptions declared in the addApi (Api, O) method

Where is my build code GoogleApiClient:

mGoogleApiClient = new GoogleApiClient.Builder(this)
    .addApi(Fitness.API)
    .addScope(new Scope(Scopes.FITNESS_ACTIVITY_READ_WRITE))
    .addConnectionCallbacks(this)
    .addOnConnectionFailedListener(this)
    .build();
+4
1

Google Play 7.0:

Fitness.API, GoogleApiClient, API-, API- Google Fit Android:

GoogleApiClient, API-, . , SensorsApi, RecordingApi, :

mGoogleApiClient = new GoogleApiClient.Builder(this)
    .addApi(Fitness.SENSORS_API)
    .addApi(Fitness.REPORTING_API)
    .addScope(new Scope(Scopes.FITNESS_ACTIVITY_READ_WRITE))
    .addConnectionCallbacks(this)
    .addOnConnectionFailedListener(this)
    .build();

. , Google Play, , , API Google Play 7.0, :

, Google Fit, . , , Google Play, , , Google Fit, .

+11

All Articles