android - 谷歌健身许可

标签 android google-fit

我想在主屏幕上显示一个“connect to fit”按钮,但前提是它还没有连接。

我该如何检查这一点,因为如果我连接我的客户端但未获批准,则该应用会请求权限。设置共享首选项不是解决方案,因为用户稍后可以在系统设置中(应用程序外部)撤销批准。

最佳答案

尝试查看 documentation for google fit :

我认为这是每次您的应用访问数据(读/写)时都需要用户同意的设计。

此外,要获得授权,您需要执行以下操作:

  • Register your Android app with a project in the Google Developers Console.
  • Specify a scope of access when connecting to the fitness service.

关于android - 谷歌健身许可,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46682258/

相关文章:

android - AndEngine全图像背景(宽度和高度)

android - 以与 Google Fit 应用程序相同的方式获取 Google Fit 历史记录(Google Fit 自动记录的 Activity )

java - Google Fit Api 过滤手动添加的 Activity

java - Android - forName() 方法 ClassNotFoundException

android - 在 Android 中通过 Content Provider 提供图像

android - Firebase 事件不显示 NAME 属性

android - 将 IntelliJ 与 Android 插件一起使用,而不是使用 Android Studio

Android:Google Fit: session 开始/结束 BroadcastReceivers 未触发

java - Polar 心率传感器不可用作 google fit api 中的数据源 (xamarin android)

android - 如果 GoogleApiClient 断开连接,OnDataPointListener 不会得到回调