Authorization on Android

User consent is always required before your app can read or write fitness data. To obtain authorization:

  • Register your Android app with a project in the Google Developers Console.
  • Specify a scope of access when connecting to the fitness service.

In Google Fit, scopes are strings that determine what kinds of fitness data an app can access and the level of access to this data.

Figure 1: The consent screen.

Authorization flow

The authorization flow is the following:

  1. Your app requests a connection, for one or more data types, to the fitness service.
  2. Google Fit prompts the user to grant your app the required permissions.
  3. If the user consents, your app can access fitness data of the requested types.

The specific permissions requested from the user depend on the data types that your app specifies when connecting to the service.

For an example on how to specify data types when connecting to the service, see Getting Started. For more information about data types, see Fitness Data Types.

Send feedback about...