# Android code samples

The [Google Fit repo on GitHub](https://github.com/android/fit) has code samples
explaining how to use the Android APIs. There are also code snippets for other
common tasks in the [developer guide](https://developers.google.com/fit/android).

### Read data from sensors

[GitHub code sample to register listeners](https://github.com/android/fit-samples/tree/master/BasicSensorsApiKotlin)
to read raw sensor data from a data source.

### Record data to Fit storage

[GitHub code sample to request automated storage of sensor data](https://github.com/android/fit-samples/tree/master/BasicRecordingApiKotlin)
by creating subscriptions.

### Read data from Google Fit

[GitHub code sample to read data from the user's fitness history](https://github.com/android/fit-samples/tree/master/BasicHistoryApiKotlin).

### Work with sessions

[GitHub code sample to demonstrate sessions](https://github.com/android/fit-samples/tree/master/BasicHistorySessionsKotlin):
Encapsulate fitness data as a logical [session](https://developers.google.com/fit/android/using-sessions),
to represent an overall workout.

### Step counter

[GitHub code sample to record steps and read them back](https://github.com/android/fit-samples/tree/master/StepCounterKotlin).