Android Wear 100% packet loss

China☆狼群 提交于 2019-12-13 01:16:31

问题


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

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


回答1:


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.

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.



来源:https://stackoverflow.com/questions/33959780/android-wear-100-packet-loss

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!