Android Wear 100% 丢包 [英] Android Wear 100% packet loss
问题描述
刚刚编写我的第一个穿戴应用程序 - 在模拟器上一切正常 - 不幸的是,在真实设备(索尼智能手表 3)上,该应用程序失败,因为它无法访问互联网.即使在 adb shell 上我也有问题
Was just writing my first wear app - everything works fine on the emulator - unfortunately on a real device ( Sony smartwatch 3 ) the app failed because it could not reach the internet. Even on adb shell I have problems
22|shell@tetra:/ $ ping google.com
PING google.com (173.194.112.33) 56(84) bytes of data.
^C
--- google.com ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5017ms
这发生在有wifi和没有wifi的情况下(然后根据我的理解,网络是通过手机的蓝牙来的)重启不能解决问题,我没有想法
This is happening with wifi and without ( then from my understanding the network comes via bluetooth from the phone ) A reboot is not solving the problem and I am out of ideas
推荐答案
如果您的手表已连接到 wifi 而未连接到您的手机(通过 BT),那么您将可以在手表上访问 wifi,并且 ping 应该可以工作(我刚刚测试过).确保当时禁用了与手机的 BT 连接非常重要,否则,只要有与手机的 BT 连接,框架就会禁用 WiFi.
If your watch is connected to wifi and NOT connected to your phone (via BT), then you will have wifi access on your watch and ping should work (I just tested that). It is very important to make sure that your BT connectivity to your phone is disabled at that time otherwise, as long as there is a BT connectivity to your phone, WiFi is disabled by the framework.
我不确定您正在编写什么应用程序,但您不应依赖手表的直接 wifi 连接的可用性,而应将您的应用程序设计为主要依赖配套手机,当配对并连接时,然后其他意味着(例如,wifi)如果手表未连接但您仍然有 wifi.请注意,WiFi 会消耗更多电池,因此请注意这一点.
I am not sure what application you are writing but you should not rely on the availability of direct wifi connectivity for your watch and should design your app to mostly rely on the companion phone, when one is paired and connected, and then other means (say, wifi) if watch is not connected but you still have wifi. Note that WiFi consumes a lot more battery so be mindful of that as well.
这篇关于Android Wear 100% 丢包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!