Android Question is it possible to identify remote device connect disconnect status while connecting via Bluetooth B4A?

ravi93

Member
I am trying to implement auto-connect with a previously connected Bluetooth device, but I am not able to detect remote device disconnection status, can anyone please help me to resolve this issue.
 

drgottjr

Expert
Licensed User
Longtime User
you need to re-phrase your question. you don't indicate whether you're referring to classic bluetooth or ble.

there is no auto connect for classic bluetooth, and for ble, auto-connect has nothing to do with previously
connected devices. you can auto connect to any connectable ble device when it comes into range. (i assume you
have implemented your gatt callback and necessary permissions.)

and when you say "connect", do you mean "connect" or "pair"? it sounds like you mean pair, which is not the same thing.

and when you say "detect", are you talking about monitoring connection status of a device? or are you simply trying to
determine if a device is not connected at some discrete point in time? (most people want to know if a device is connected,
since the only way to know if a device is not connected is to determine who is connected and compare the addresses of
those devices to the address of the particular device whose status you're interested in.) in other words, there is no
isNotConnected() method. it's safe to assume that there are probably hundreds of millions of devices which are not
currently connected to your smartphone. (technically, there is a hidden isConnected() method, but it's not how android
wants us to know about a device's status since it doesn't tell you when a device disconnects. this is already handled
through the gatt callback.)
 
Upvote 0
Top