Stay organized with collections
Save and categorize content based on your preferences.
The Google Fit repo on GitHub has code samples
explaining how to use the Android APIs. There are also code snippets for other
common tasks in the developer guide.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-05-07 UTC."],[[["\u003cp\u003eThe Google Fit repository on GitHub provides code samples demonstrating how to use Android APIs for fitness data.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can find code snippets for common tasks like reading sensor data, recording data, working with sessions, and utilizing the step counter, within the Google Fit repository and developer guide.\u003c/p\u003e\n"],["\u003cp\u003eAccess various GitHub code samples to learn about registering sensor listeners, requesting automated data storage, reading fitness history, and implementing sessions in your fitness applications.\u003c/p\u003e\n"]]],[],null,["The [Google Fit repo on GitHub](https://github.com/android/fit) has code samples\nexplaining how to use the Android APIs. There are also code snippets for other\ncommon tasks in the [developer guide](/fit/android).\n\nRead data from sensors\n\n[GitHub code sample to register listeners](https://github.com/android/fit-samples/tree/master/BasicSensorsApiKotlin)\nto read raw sensor data from a data source.\n\nRecord data to Fit storage\n\n[GitHub code sample to request automated storage of sensor data](https://github.com/android/fit-samples/tree/master/BasicRecordingApiKotlin)\nby creating subscriptions.\n\nRead data from Google Fit\n\n[GitHub code sample to read data from the user's fitness history](https://github.com/android/fit-samples/tree/master/BasicHistoryApiKotlin).\n\nWork with sessions\n\n[GitHub code sample to demonstrate sessions](https://github.com/android/fit-samples/tree/master/BasicHistorySessionsKotlin):\nEncapsulate fitness data as a logical [session](/fit/android/using-sessions),\nto represent an overall workout.\n\nStep counter\n\n[GitHub code sample to record steps and read them back](https://github.com/android/fit-samples/tree/master/StepCounterKotlin)."]]