Android용 Google 피트니스 API는 Google Play 서비스의 일부입니다. Google 피트니스 API는 Android 4.1 (API 수준 16) 이상에서 지원됩니다. 이러한 API를 사용하면 앱에서 다음 작업을 할 수 있습니다.
저전력 블루투스 (BLE) 기기의 데이터를 포함하여 실시간에 가까운 이전 데이터와 이전 데이터를 읽습니다.
활동을 기록합니다.
데이터를 세션에 연결합니다.
피트니스 목표를 설정하세요.
센서 데이터 읽기
앱에서 일일 걸음 수와 같은 사용자 활동에 관한 정보를 제공한다면 사용자의 움직임에 관한 데이터를 실시간에 가깝게 표시하는 것이 도움이 될 수 있습니다.
Sensors API는 이 정보가 포함된 원시 데이터 스트림에 대한 액세스를 제공합니다. 데이터는 Android 지원 기기에서 사용할 수 있는 센서는 물론 웨어러블 기기와 같은 호환 기기의 센서에서 가져올 수 있습니다.
데이터 기록
앱에서 사용자의 실제 활동에 관한 데이터를 수집, 저장, 동기화해야 한다면 Recording API를 사용할 수 있습니다. 이 API는 정기 결제를 사용하여 건강 및 웰빙 데이터를 저장합니다. 앱은 기록할 활동 유형을 하나 이상 지정합니다. 그러면 Google 피트니스는 앱이 실행되지 않을 때도 지정된 유형의 데이터를 백그라운드에서 저장합니다. 또한 시스템이 다시 시작될 때 이러한 구독을 복원합니다.
그림 1. Android의 Google 피트니스
이전 데이터
사용자가 이전 활동의 피트니스 데이터를 볼 수 있도록 하려면 History API를 사용하면 됩니다. 이 API를 사용하면 이전 건강 및 웰빙 데이터에 액세스할 수 있으며 앱에서 데이터 삽입, 삭제, 읽기와 같은 일괄 작업을 실행할 수 있습니다.
세션
피트니스 데이터는 그 자체만으로도 유용할 수 있지만, 사용자 활동에 관한 추가 정보와 결합하면 데이터가 더 유용합니다. Sessions API는 일부 메타데이터와 함께 건강 및 웰빙 데이터를 세션이라는 단위로 묶습니다. 세션은 사용자가 피트니스 활동을 실행하는 동안의 시간 간격을 나타냅니다.
목표 보기 및 설정
앱은 사용자의 피트니스 활동과 사용자가 설정한 목표를 비교하여 사용자에게 동기를 부여할 수 있습니다. Goals API를 사용하면 앱에서 사용자가 만든 건강 및 피트니스 목표를 표시할 수 있습니다.
[null,null,["최종 업데이트: 2025-08-31(UTC)"],[[["\u003cp\u003eThe Google Fit APIs let your Android app read, record, and store fitness and wellness data from various sources, including BLE devices.\u003c/p\u003e\n"],["\u003cp\u003eApps can use the Recording API to continuously track user activity in the background, even when the app isn't actively running.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access and manage historical fitness data, enabling users to view past activities and trends through the History API.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Fit allows data to be grouped into sessions, providing context and insights into specific user activities with the Sessions API.\u003c/p\u003e\n"],["\u003cp\u003eApps can leverage the Goals API to display and manage user fitness goals, promoting engagement and motivation.\u003c/p\u003e\n"]]],[],null,["# Android APIs\n\nThe Google Fit APIs for Android are part of [Google Play\nservices](/android/guides/overview). The Google Fit APIs are supported on\nAndroid 4.1 (API level 16) and higher. Using these APIs, your app can do the\nfollowing:\n\n- Read near-real-time and historic data, including data from Bluetooth Low Energy (BLE) devices.\n- Record activities.\n- Associate data with a session.\n- Set fitness goals.\n\nRead sensor data\n----------------\n\nIf your app provides information about a user's activity, such as their daily\nsteps, it can be helpful to show near-real-time data about the user's movements.\nThe [Sensors API](/fit/android/sensors) provides access to streams of raw data\nthat contain this information. The data can come from sensors available on the\nAndroid-powered device as well as from sensors in companion devices, such as\nwearables.\n\nRecord data\n-----------\n\nIf your app needs to gather, store, and sync data about a user's physical\nactivity, you can use the [Recording API](/fit/android/record). This API stores\nhealth and wellness data using subscriptions. Your app specifies one or more\ntypes of activities to record. Google Fit then stores data of the\nspecified types in the background even when your app isn't running. It also\nrestores these subscriptions when the system is restarted. \n**Figure 1.** Google Fit on Android.\n\nHistorical data\n---------------\n\nIf you want users to be able to view fitness data from past activities, you can\nuse the [History API](/fit/android/history). This API provides access to the\nhistorical health and wellness data and lets apps perform bulk operations, such\nas inserting, deleting, and reading data.\n\nSessions\n--------\n\nFitness data can be beneficial by itself, but the data is more useful when you\ncombine it with additional information about the user's activity. The [Sessions\nAPI](/fit/android/using-sessions) bundles health and wellness data, along with\nsome metadata, into units called *sessions*. Sessions represent a time interval\nduring which the user performs a fitness activity.\n\nView and set goals\n------------------\n\nYour app can help motivate users by showing how their fitness activity compares\nto the goals that they've set. The [Goals API](/fit/android/goals) helps your\napp show users the health and fitness goals that they've created."]]