FitnessStatusCodes | Android Developers

Quicknav Quicknav
Links

- Google Play Developer Console
- Android Developers Blog
- About Android

Android Sites

- Android.com
- Android Developers
- Android Open Source Project

Language
close

- - About
  - Wear
  - TV
  - Auto
- - Get Started
  - Devices
  - Style
  - Patterns
  - Building Blocks
  - Downloads
  - Videos
- - Training
  - API Guides
  - Reference
  - Tools
  - Google Services
  - Samples
- - Google Play
  - Essentials
  - Get Users
  - Engage & Retain
  - Monetize
  - Analyze
  - Tools & Reference
  - Developer Stories

## Results

Loading...
Summary: Constants | Inherited Constants | Ctors | Inherited Methods | [Expand All]
public class

# FitnessStatusCodes

extends CommonStatusCodes

java.lang.Object
↳ | com.google.android.gms.common.api.CommonStatusCodes
| ↳ | com.google.android.gms.fitness.FitnessStatusCodes

## Class Overview

Google Fit specific status codes, for use in `getStatusCode()`

## Summary

Constants
int | AGGREGATION_NOT_SUPPORTED | Status code denotes that a read request specified an un-supported data type as input for aggregation.
int | API_EXCEPTION | Status code denotes that an API call to Google backend failed, due to possible network issues.
int | APP_MISMATCH | Status code denotes that the app tried to insert data form the wrong app.
int | APP_NOT_FIT_ENABLED | Status code denotes that an app was not found in the list of connected apps in Google Fit.
int | CONFLICTING_DATA_TYPE | Status code denotes that the app attempted to insert a conflicting DataType, i.e.
int | DATA_TYPE_NOT_FOUND | Status code denotes that the requested data type was not found.
int | DISABLED_BLUETOOTH | Status code denotes that Bluetooth is currently disabled.
int | EQUIVALENT_SESSION_ENDED | Status code denotes that a session could not be started because an equivalent session has already ended.
int | INCONSISTENT_DATA_TYPE | Status code denotes that the app attempted to insert a DataType whose name does not match the app's package name.
int | INCONSISTENT_PACKAGE_NAME | Status code denotes that app attempted to insert data for a DataSource that does not match the app's package name.
int | MISSING_BLE_PERMISSION | Status code denotes that the app is missing the required Bluetooth permissions in its manifest.
int | NEEDS_OAUTH_PERMISSIONS | Status code denotes that the request is missing desired OAuth permissions.
int | SUCCESS_ALREADY_SUBSCRIBED | The subscribe request succeeded, but the subscription already existed, so it was a no-op.
int | SUCCESS_NO_CLAIMED_DEVICE | The unclaim request succeeded, but no matching claimed device was found.
int | SUCCESS_NO_DATA_SOURCES | The subscribe request succeeded, but no data sources are currently available that match it.
int | TRANSIENT_ERROR | Status code denotes that there was a transient error accessing Google Fit services.
int | UNKNOWN_AUTH_ERROR | Status code denotes that an unknown error occurred while trying to obtain an OAuth token.
int | UNSUPPORTED_ACCOUNT | Status code denotes that the account is not supported.
int | UNSUPPORTED_PLATFORM | Status code denotes that the operation is not supported by Google Fit.

[Expand] Inherited Constants
From class com.google.android.gms.common.api.CommonStatusCodes
int | CANCELED | The result was canceled either due to client disconnect or `cancel()`.
int | DEVELOPER_ERROR | The application is misconfigured.
int | ERROR | The operation failed with no more detailed information.
int | INTERNAL_ERROR | An internal error occurred.
int | INTERRUPTED | A blocking call was interrupted while waiting and did not run to completion.
int | INVALID_ACCOUNT | The client attempted to connect to the service with an invalid account name specified.
int | LICENSE_CHECK_FAILED | The application is not licensed to the user.
int | NETWORK_ERROR | A network error occurred.
int | RESOLUTION_REQUIRED | Completing the operation requires some form of resolution.
int | SERVICE_DISABLED | The installed version of Google Play services has been disabled on this device.
int | SERVICE_INVALID | The version of the Google Play services installed on this device is not authentic.
int | SERVICE_MISSING | Google Play services is missing on this device.
int | SERVICE_VERSION_UPDATE_REQUIRED | The installed version of Google Play services is out of date.
int | SIGN_IN_REQUIRED | The client attempted to connect to the service but the user is not signed in.
int | SUCCESS | The operation was successful.
int | SUCCESS_CACHE | The operation was successful, but was used the device's cache.
int | TIMEOUT | Timed out while awaiting the result.

Public Constructors
| FitnessStatusCodes()

[Expand] Inherited Methods
From class com.google.android.gms.common.api.CommonStatusCodes
static String | getStatusCodeString(int statusCode)
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)

## Constants

#### public static final int AGGREGATION_NOT_SUPPORTED

Status code denotes that a read request specified an un-supported data type as input for aggregation.

Constant Value: 5012 (0x00001394)

#### public static final int API_EXCEPTION

Status code denotes that an API call to Google backend failed, due to possible network issues.

Constant Value: 5011 (0x00001393)

#### public static final int APP_MISMATCH

Status code denotes that the app tried to insert data form the wrong app.

Constant Value: 5004 (0x0000138c)

#### public static final int APP_NOT_FIT_ENABLED

Status code denotes that an app was not found in the list of connected apps in Google Fit. Signifies that either access to the app was already revoked, or the app is not registered on the developer's console.

Constant Value: 5010 (0x00001392)

#### public static final int CONFLICTING_DATA_TYPE

Status code denotes that the app attempted to insert a conflicting DataType, i.e. there is an existing DataType with the same name and different fields.

Constant Value: 5001 (0x00001389)

#### public static final int DATA_TYPE_NOT_FOUND

Status code denotes that the requested data type was not found.

Constant Value: 5003 (0x0000138b)

#### public static final int DISABLED_BLUETOOTH

Status code denotes that Bluetooth is currently disabled.

Constant Value: 5014 (0x00001396)

#### public static final int EQUIVALENT_SESSION_ENDED

Status code denotes that a session could not be started because an equivalent session has already ended.

Constant Value: 5009 (0x00001391)

#### public static final int INCONSISTENT_DATA_TYPE

Status code denotes that the app attempted to insert a DataType whose name does not match the app's package name.

Constant Value: 5002 (0x0000138a)

#### public static final int INCONSISTENT_PACKAGE_NAME

Status code denotes that app attempted to insert data for a DataSource that does not match the app's package name.

Constant Value: 5015 (0x00001397)

#### public static final int MISSING_BLE_PERMISSION

Status code denotes that the app is missing the required Bluetooth permissions in its manifest.

Constant Value: 5006 (0x0000138e)

#### public static final int NEEDS_OAUTH_PERMISSIONS

Status code denotes that the request is missing desired OAuth permissions.

If an app does not have the required OAuth access for a specific API request, the request will fail with this status code. When this occurs, apps can use the pending intent inside the status object to request the necessary access before retrying the request.

Sample usage when access is missing for a request:

         PendingResult pendingResult = FitnessApi.readData(fitnessRequest);
         Result result = pendingResult.await(3L, TimeUnit.SECONDS);
         Status = result.getStatus();

         if (!status.isSuccess()) {
              if (status.getStatusCode() == FitnessStatusCodes.NEEDS_OAUTH_PERMISSIONS) {
                  status.startResolutionForResult(
                          myActivity,
                          MY_ACTIVITYS_AUTH_REQUEST_CODE);
              }
         }

Constant Value: 5000 (0x00001388)

#### public static final int SUCCESS_ALREADY_SUBSCRIBED

The subscribe request succeeded, but the subscription already existed, so it was a no-op.

Constant Value: -5001 (0xffffec77)

#### public static final int SUCCESS_NO_CLAIMED_DEVICE

The unclaim request succeeded, but no matching claimed device was found. No changes were made.

Constant Value: -5002 (0xffffec76)

#### public static final int SUCCESS_NO_DATA_SOURCES

The subscribe request succeeded, but no data sources are currently available that match it. Recording of data will start when data sources become available.

Constant Value: -5000 (0xffffec78)

#### public static final int TRANSIENT_ERROR

Status code denotes that there was a transient error accessing Google Fit services. Clients may retry.

Constant Value: 5008 (0x00001390)

#### public static final int UNKNOWN_AUTH_ERROR

Status code denotes that an unknown error occurred while trying to obtain an OAuth token.

Constant Value: 5005 (0x0000138d)

#### public static final int UNSUPPORTED_ACCOUNT

Status code denotes that the account is not supported.

Constant Value: 5013 (0x00001395)

#### public static final int UNSUPPORTED_PLATFORM

Status code denotes that the operation is not supported by Google Fit.

Constant Value: 5007 (0x0000138f)

## Public Constructors

#### public FitnessStatusCodes ()