开发者

Android Bluetooth Notification

开发者 https://www.devze.com 2023-02-19 08:39 出处:网络
I am developing an Bluetooth application in android.Once connection is made between two devices i am sending data between t开发者_Go百科wo devices. My problem is whenever either of the devices Bluetoo

I am developing an Bluetooth application in android.Once connection is made between two devices i am sending data between t开发者_Go百科wo devices. My problem is whenever either of the devices Bluetooth is turned off i want that to be notified to other device and want to print a toast message stating that "Other device Bluetooth is turned off".How to do this?

Thanks


You can monitor the bluetooth connection (listening to Broadcast action : ACTION_ACL_DISCONNECTED) and notify that the connection has gone. Dropping of connection does not necessarily mean it is powered off , but it is surely a side-effect.


The following link can be useful to you

  • notification if the Bluetooth is turned off in android app
0

精彩评论

暂无评论...
验证码 换一张
取 消