简体   繁体   English

将Android应用重新连接到配对的蓝牙设备

[英]Reconnecting an Android app to a paired bluetooth device

I am developing an Android app that connects beautifully to a Bluetooth device. 我正在开发一个可以与蓝牙设备完美连接的Android应用。 If that device is turned off, the BT connection is lost, understandably. 如果可以关闭该设备,则BT连接将会丢失。 I would like to reconnect with the device when it is turned back on or comes back in range. 我想在重新打开设备或重新进入范围时重新连接设备。 Is there an intent sent out by the system when it detects a paired BT device that I can catch with a broadcastreceiver or some other way? 当系统检测到我可以用广播接收器或其他方式捕获的配对BT设备时,系统是否发出了意图?

I dont think there is an automatic way to do that. 我认为没有自动的方法可以做到这一点。

However, you can have a service scanning periodically for devices and notifying your application when this specific device is found. 但是,您可以定期对设备进行service扫描,并在找到该特定设备时通知您的应用程序。

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

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