Interfejsy Google Fit API, w tym interfejs Google Fit API typu REST, zostaną wycofane w 2026 roku. Od 1 maja 2024 r. deweloperzy nie mogą rejestrować się w celu korzystania z tych interfejsów API.
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Google Fit to otwarty ekosystem. Umożliwia deweloperom przesyłanie danych o zdrowiu i samopoczuciu do centralnego repozytorium, gdzie użytkownicy będą mieli dostęp do danych z różnych urządzeń i aplikacji w jednym miejscu. Po przejściu
na nowe urządzenie zachowają dostęp do swoich danych.
Aplikacja dotycząca zdrowia i samopoczucia może przechowywać dane z dowolnego urządzenia do noszenia lub czujnika oraz uzyskiwać dostęp do danych utworzonych przez inne aplikacje.
Centrum, w którym przechowywane są dane z różnych urządzeń i aplikacji. Centrum fitness to usługa w chmurze, która jest przejrzysta dla klientów.
Struktura czujnika
Zestaw ogólnych informacji, które ułatwiają współpracę ze sklepem fitness. Takie reprezentacje są używane w interfejsach API Google Fit.
Uprawnienia i kontrola użytkowników
Zestaw zakresów autoryzacji, na podstawie których można prosić użytkownika o zgodę na pracę z danymi o zdrowiu i samopoczuciu. Google Fit wymaga zgody użytkownika na dostęp do danych o zdrowiu i samopoczuciu.
Interfejsy API Google Fit
Androida i interfejsy API typu REST zapewniające dostęp do sklepu fitness. Aplikacje obsługujące Google Fit
możesz tworzyć na różnych platformach i urządzeniach, np. na urządzeniach z Androidem i iOS oraz w aplikacjach internetowych.
Sklep fitness
Sklep fitness to usługa w chmurze, która przechowuje dane o zdrowiu i samopoczuciu za pomocą infrastruktury Google. Aplikacje na różnych platformach i urządzeniach mogą
przechowywać dane i korzystać z danych utworzonych przez inne aplikacje. Google Fit udostępnia zestaw interfejsów API, które ułatwiają
wstawianie danych i wysyłanie zapytań do sklepu fitness.
Struktura czujnika
Struktura czujników definiuje ogólny obraz czujników, typów danych, punktów danych i sesji. Te informacje ułatwiają współpracę
ze sklepem fitness na dowolnej platformie.
Źródła danych
Źródła danych reprezentują czujniki i składają się z nazwy, typu zbieranych danych oraz innych szczegółów. Źródło danych może reprezentować czujnik sprzętowy lub programowy. Możesz zdefiniować czujniki oprogramowania w swoich aplikacjach.
Typy danych
Typy danych reprezentują różne rodzaje danych o zdrowiu i samopoczuciu, takie jak liczba kroków czy tętno. Typy danych tworzą schemat, za pomocą którego różne aplikacje
mogą interpretować dane innych użytkowników. Typ danych składa się z nazwy i uporządkowanej listy pól, przy czym każde pole reprezentuje wymiar. Na przykład typ danych dotyczący lokalizacji zawiera 3 pola (szerokość, długość i dokładność), a typ danych dotyczący wagi zawiera tylko jedno pole.
Punkty danych
Punkty danych składają się z tablicy z sygnaturami czasowymi wartości danego typu odczytywanych ze źródła. Punkty danych służą do zapisywania i wstawiania danych o zdrowiu i samopoczuciu w sklepie fitness oraz do odczytywania nieprzetworzonych danych ze źródła. Punkty zawierające czas rozpoczęcia reprezentują zakres czasowy, a nie natychmiastowe odczyty.
Zbiory danych
Zbiory danych reprezentują zbiór punktów danych tego samego typu z danego źródła w określonym przedziale czasu. Za pomocą zbiorów danych
umieszczasz dane w centrum fitness. Zapytania do odczytu danych z centrum fitness zwracają również zbiory danych.
Sesje
Sesje to przedział czasu, w którym użytkownicy wykonują działania fitness, takie jak bieg, jazda na rowerze itd. Sesje pomagają w porządkowaniu danych i wykonywaniu szczegółowych lub zbiorczych zapytań dotyczących aktywności w sklepie fitness.
Uprawnienia i kontrola użytkowników
Google Fit wymaga zgody użytkownika, zanim aplikacje będą mogły odczytywać lub przechowywać dane o zdrowiu i samopoczuciu.
Google Fit definiuje zakresy protokołu OAuth mapowane na grupy uprawnień z osobnymi uprawnieniami do odczytu i zapisu: dane o aktywności, ciele, lokalizacji, odżywianiu i zdrowiu (typy danych związanych ze zdrowiem są grupowane na większą skalę). Każda grupa uprawnień przyznaje aplikacjom dostęp do zbioru typów danych.
Aplikacje określają co najmniej 1 z tych zakresów do obsługi danych o zdrowiu i samopoczuciu, a Google Fit prosi użytkownika o odpowiednie uprawnienia.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-08-31 UTC."],[[["\u003cp\u003eGoogle Fit provides a central platform and APIs for storing, accessing, and sharing health and wellness data from various apps and devices.\u003c/p\u003e\n"],["\u003cp\u003eUsers have control over their data and must grant permission for apps to access it.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can build apps that integrate with Google Fit using Android or REST APIs, supporting cross-platform functionality.\u003c/p\u003e\n"],["\u003cp\u003eData is organized using data sources, data types, data points, datasets, and sessions for efficient storage and retrieval.\u003c/p\u003e\n"],["\u003cp\u003eCompliance with the Google Fit Developer and User Data Policy and Terms and Conditions is essential when utilizing the platform.\u003c/p\u003e\n"]]],[],null,["# Platform Overview\n\nGoogle Fit is an open ecosystem. It lets developers upload health and wellness\ndata to a central repository where users can access their data from different\ndevices and apps in one location. They can still access their data if they\nupgrade to a new device.\n\nYour health and wellness app can store data from any wearable or sensor, and\naccess data created by other apps.\n| **Note:** The Google Fit app uses the Google Fit platform, which is included in Google Play services. Your app can use this platform without needing users to install the Google Fit app.\n\nRead the [Google Fit Developer and User Data Policy](/fit/policy) thoroughly and\nmake sure your app complies with it. Carefully review the [Google Fit Terms and\nConditions](/fit/terms) before using Google Fit. By using the API, you agree to\nthe Google Fit Terms and Conditions.\n\nComponents\n----------\n\nGoogle Fit consists of the following components: \n**Figure 1** : Platform overview.\n\nThe fitness store\n: A central repository that stores data from a variety of devices and apps. The\n fitness store is a cloud service that is transparent to clients.\n\nThe sensor framework\n: A set of high-level representations that make it easy to work with the fitness\n store. You use these representations with the Google Fit APIs.\n\nPermissions and user controls\n: A set of authorization scopes to request user permission to work with health\n and wellness data. Google Fit requires user consent to access health and\n wellness data.\n\nGoogle Fit APIs\n: Android and REST APIs to access the fitness store. You can create apps that\n support Google Fit on multiple platforms and devices, such as Android, iOS, and\n Web apps.\n\nThe fitness store\n-----------------\n\nThe fitness store is a cloud service that persists health and wellness data using Google's\ninfrastructure. Apps on different platforms and devices can store data and\naccess data created by other apps. Google Fit provides a set of APIs that make\nit easy to insert data and query the fitness store.\n\nThe sensor framework\n--------------------\n\nThe sensor framework defines high-level representations for sensors,\ndata types, data points, and sessions. These representations make it easy to\nwork with the fitness store on any platform.\n\nData Sources\n: Data sources represent sensors and consist of a name, the type of data\n collected, and other sensor details. A data source may represent a hardware\n sensor or a software sensor. You can define software sensors in your apps.\n\nData Types\n: Data types represent different kinds of health and wellness data, like step count or heart\n rate. Data types establish a schema through which different apps can understand\n each other's data. A data type consists of a name and an ordered list of fields,\n where each field represents a dimension. For example, a data type for location\n contains three fields (latitude, longitude, and accuracy), whereas a data type\n for weight contains only one field.\n\nData Points\n: Data points consist of a timestamped array of values for a data type, read\n from a data source. You use data points to record and insert health and wellness data in the\n fitness store, and to read raw data from a data source. Points that contain a\n start time represent a time range instead of an instantaneous reading.\n\nDatasets\n: Datasets represent a set of data points of the same type from a particular\n data source covering some time interval. You use datasets to insert data into\n the fitness store. Queries to read data from the fitness store also return\n datasets.\n\nSessions\n: Sessions represent a time interval during which users perform a fitness\n activity, such as a run, a bike ride, and so on. Sessions help organize data and\n perform detailed or aggregate queries on the fitness store for a fitness\n activity.\n\nPermissions and user controls\n-----------------------------\n\nGoogle Fit requires user consent before apps can read or store health and wellness data.\nGoogle Fit defines OAuth scopes that map to a number of permission groups with\nseparate read and write privileges: activity, body, location, nutrition and\nhealth-related data types (health-related data types are grouped with finer\ngranularity). Each permission group grants apps access to a set of data types.\nApps specify one or more of these scopes to work with health and wellness data, and Google\nFit requests the corresponding permissions from the user.\n\nGoogle Fit APIs\n---------------\n\nGoogle Fit provides the following APIs:\n\n- [Android APIs](/fit/android) for Android apps.\n- [REST API](/fit/rest) for apps on any platform."]]