Google Fit REST API de dahil olmak üzere Google Fit API'lerinin desteği 2026'da sonlandırılacak. 1 Mayıs 2024'ten itibaren geliştiriciler bu API'leri kullanmak için kaydolamaz.
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Android için Google Fit API'ları, Google Play hizmetlerinin bir parçasıdır. Google Fit API'leri, Android 4.1 (API seviyesi 16) ve sonraki sürümlerde desteklenir. Uygulamanız bu API'leri kullanarak aşağıdakileri yapabilir:
Bluetooth Düşük Enerji (BDE) cihazlarından gelen veriler de dahil olmak üzere neredeyse gerçek zamanlı ve geçmiş verileri okuyun.
Etkinlikleri kaydedebilirsiniz.
Verileri bir oturumla ilişkilendirin.
Fitness hedefleri belirleyin.
Sensör verilerini okuma
Uygulamanız bir kullanıcının etkinlikleri hakkında, günlük adımları gibi bilgiler sağlıyorsa kullanıcının hareketleri hakkında neredeyse gerçek zamanlı veriler göstermek yararlı olabilir.
Sensors API, bu bilgileri içeren ham veri akışlarına erişim sağlar. Veriler, Android destekli cihazlarda bulunan sensörlerden veya giyilebilir cihazlar gibi tamamlayıcı cihazlardaki sensörlerden gelebilir.
Verileri kaydet
Uygulamanızın, kullanıcının fiziksel etkinliğiyle ilgili veri toplaması, depolaması ve senkronize etmesi gerekiyorsa Recording API'yi kullanabilirsiniz. Bu API, abonelikleri kullanarak sağlık ve sağlıklı yaşam verilerini depolar. Uygulamanız kaydedilecek bir veya daha fazla
aktivite türü belirtiyor. Daha sonra Google Fit, uygulamanız çalışmıyorken bile belirtilen türlerdeki verileri arka planda depolar. Ayrıca,
sistem yeniden başlatıldığında bu abonelikler de geri yüklenir.
Şekil 1. Android'de Google Fit.
Geçmiş verileri
Kullanıcıların geçmiş aktivitelere ait fitness verilerini görüntüleyebilmelerini istiyorsanız History API'sini kullanabilirsiniz. Bu API geçmiş sağlık ve sağlıklı yaşam verilerine erişim sağlar ve uygulamaların veri ekleme, silme ve okuma gibi toplu işlemler gerçekleştirmesine olanak tanır.
Oturum sayısı
Fitness verileri kendi başına yararlı olabilir ancak kullanıcının aktivitesi hakkında ek bilgilerle birleştirildiğinde daha faydalı olur. Sessions API, sağlık ve zindelik verilerini, bazı meta verilerle birlikte oturumlar adı verilen birimler halinde gruplandırır. Oturumlar, kullanıcının fitness aktivitesi
gerçekleştirdiği zaman aralığını temsil eder.
Hedefleri görüntüleyin ve belirleyin
Uygulamanız, fitness aktivitelerinin belirledikleri hedeflere kıyasla ne durumda olduğunu göstererek kullanıcıları motive etmeye yardımcı olabilir. Goals API, uygulamanızın kullanıcılara oluşturdukları sağlık ve fitness hedeflerini göstermesine yardımcı olur.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 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."]]