简体   繁体   English

Android Wear:蓝牙与wifi连接

[英]Android Wear: bluetooth vs wifi connection

How to detect if Android wear switched the connection from bluetooth to wifi or vice versa? 如何检测Android Wear是否将连接从蓝牙切换为wifi,反之亦然? And is there a way to force it to connect via bluetooth? 有没有办法强迫它通过蓝牙连接?

Being an Android framework, you can register a broadcast receiver to be notified when connectivity status changes. 作为Android框架,您可以注册一个广播接收器,以在连接状态更改时得到通知。 In general, when your watch is connected to a phone directly (which only happens via BT), wifi connection is dropped and when it is not connected, if your phone is wifi capable and if a wifi network is available, it gets connected to the cloud node. 通常,当您的手表直接连接到手机(仅通过BT进行连接)时,wifi连接会断开;如果未连接,则您的手机具有wifi功能,并且如果有wifi网络可用,则它会连接到云节点。 In that case, you cannot force it to connect through BT since, most likely, it is not possible (might be due to distance or many other reasons). 在那种情况下,您不能强迫它通过BT连接,因为很可能是不可能的(可能是由于距离或许多其他原因所致)。 What exactly are you trying to accomplish? 您到底想完成什么?

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

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