附近连接:Android 10上的发现问题

huangapple go评论70阅读模式
英文:

Nearby Connection : Discovery issues on Android 10

问题

使用 Nearby Connection API 的 P2P_STAR 策略,我在一个项目中遇到了与 Android 10 上的发现问题。

我已经在华为设备上进行了测试,结果是与主机根本没有连接,在一个刚刚更新的小米 MI 9t 上成功连接,但在连接几秒钟后就断开了,没有任何异常出现...

在更新之前,它在小米手机上工作得很好。

此外,我的应用在我的 Android 8 或 9 设备上工作得非常好。

我尝试添加了 ACCESS_FINE_LOCATION 权限并更新了 Google Play 服务,但没有成功...

我们项目的代码库:https://github.com/hbollon/Urbalog
所有与 Nearby 相关的内容都在 NetworkHelper 类中,权限列表在其中的常量 REQUIRED_PERMISSIONS 中。

是否有人有任何想法?
提前感谢。

英文:

For one of my project I work with Nearby Connection API with P2P_STAR strategy and I experience issue on discovery with Android 10.
I have tested with Huawei devices that resulted in no connection at all with host and on a freshly updated Xiaomi MI 9t who success to connect but disconnect few seconds after with no exceptions...
Before the update it work well on the Xiaomi.
Furthermore, my app work very well on my android 8 or 9 devices.

I tried to add ACCESS_FINE_LOCATION permission and update Google play services without success...

Our project repository : https://github.com/hbollon/Urbalog
All Nearby stuff is in NetworkHelper class and permissions list is in the constant REQUIRED_PERMISSIONS inside it.

Someone would have any idea?
Thanks in advance

答案1

得分: 2

所以我找到了问题,在我的安卓10设备上,我还没有启用位置,附近似乎无法自行启用它...
在安卓10更新之前,我从未注意到这一点,所以这是与操作系统相关的还是我之前一直都启用了它?我不知道 ^^

然而,在ConnectionsStatusCodes文档中,MISSING_SETTING_LOCATION_MUST_BE_ON 状态码被标记为已弃用(链接:https://developers.google.com/android/reference/com/google/android/gms/nearby/connection/ConnectionsStatusCodes)。
所以我想这不再是可能的情况,对吧?

英文:

So I have found the issue, on my android 10 devices I haven't activate location and Nearby seems unable to activate it itself...
I never notice that before Android 10 update so is it os related or have I always activated it before? I don't know ^^

However, on the ConnectionsStatusCodes documentation, MISSING_SETTING_LOCATION_MUST_BE_ON status code is marked as deprecated ( https://developers.google.com/android/reference/com/google/android/gms/nearby/connection/ConnectionsStatusCodes ).
So I imagine this is no longer a possible case no?

huangapple
  • 本文由 发表于 2020年4月5日 21:56:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/61043727.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定