Utilizzare i sensori Bluetooth
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
La tua app può trovare i dispositivi BLE (Bluetooth Low Energy) disponibili e inserire i dati dei sensori nella piattaforma Google Fit.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-31 UTC.
[null,null,["Ultimo aggiornamento 2025-08-31 UTC."],[[["\u003cp\u003eThe Android platform offers built-in support for Bluetooth Low Energy (BLE) on devices running Android 4.3 (API level 18) or higher, enabling apps to discover devices, query services, and exchange information.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can integrate data from BLE devices into the Google Fit platform using the \u003ccode\u003einsertData(DataSet)\u003c/code\u003e method, allowing for manual insertion of sensor data collected from local BLE sensors.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Fit data management practices are governed by the Google Fit Developer and User Data Policy to ensure data privacy and security.\u003c/p\u003e\n"]]],[],null,["# Use Bluetooth sensors\n\nYour app can find available Bluetooth Low Energy (BLE) devices and insert sensor\ndata into the Google Fit platform.\n\n- Android 4.3 (API level 18) and higher have [built-in platform support for\n Bluetooth Low Energy (BLE)](https://developer.android.com/guide/topics/connectivity/bluetooth-le)\n for devices in the [central\n role](https://developer.android.com/guide/topics/connectivity/bluetooth-le#roles).\n They provide APIs that apps can use to find devices, query for services, and\n transmit information.\n\n- To get data from a BLE device into the Google Fit platform, use the\n [`insertData(DataSet)`](/android/reference/com/google/android/gms/fitness/HistoryClient#public-taskvoid-insertdata-dataset-dataset)\n method to manually insert data from local sensors.\n\n| **Note:** For requirements that relate to the management of user data, see the [Google Fit Developer and User Data Policy](/fit/policy)."]]