简体   繁体   English

是否可以在未安装Google Fit App的情况下获取Google Fit API传感器数据?

[英]Is it possible to get Google Fit API sensor data without Google Fit App installed?

I'm trying to make an Android app to count the steps using the Google Fit API. 我正在尝试制作一个Android应用来使用Google Fit API来计算步骤。 What I was able to do was getting the steps from the sensors, but only with the Google Fit app installed. 我所能做的就是从传感器获取步骤,但是仅安装了Google Fit应用程序。 If the Google Fit app isn't installed on the device, my application doesn't receive any data from the sensors. 如果设备上未安装Google Fit应用,则我的应用不会收到来自传感器的任何数据。 Is that intentional (to get data from Google Fit API sensors I need the app installed) or is something I did wrong? 这是故意的(要从Google Fit API传感器获取数据,我需要安装该应用程序)还是我做错了什么?

Yes, it's possible to get Google Fit API sensors data. 是的,可以获取Google Fit API传感器数据。

You should use Google Fit Recording API to use Sensors API without installed Google Fit app. 您应该在未安装Google Fit应用的情况下使用Google Fit Recording API来使用Sensors API。

https://developers.google.com/fit/android/record https://developers.google.com/fit/android/record

The general point is next - your application should subscribe for some data types to collect the data without installed Google Fit app. 接下来是一般要点-您的应用程序应订阅某些数据类型以收集数据,而无需安装Google Fit应用程序。 In the case when Google Fit app is installed you don't need to use recording API because Google Fit app already uses it. 在安装Google Fit应用的情况下,您无需使用Recording API,因为Google Fit应用已在使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM