Android Question bluetooth device control during run

tango

Member
Licensed User
Longtime User
bluetooth device attached and initialize it,that device run. but when power off it and power on again during app run ,that device not running. how can we solve to control it and if error then re initilize it again with timer or service
 

DonManfred

Expert
Licensed User
Longtime User
Congratulations. This is one of the baddest descriptions i ever read here.
In fact i did understand NOTHING what you really want.
I guess you should change your issue-description.
But maybe someone other can understand your "suaheli". I cant.
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
bluetooth device attached and initialize it,that device run. but when power off it and power on again during app run ,that device not running. how can we solve to control it and if error then re initilize it again with timer or service
If I do well understand your question : you will have to watch the disconnection of the Bluetooth device to be able to reconnect it. I would use some intent filters in the manifest

B4X:
AddReceiverText(Service1, <intent-filter>
    <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
    </intent-filter>)
AddReceiverText(Service2, <intent-filter>
    <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>
    </intent-filter>)

Each service should be started when the connection or disconnection happens. Then using the Serial library you should be able to retrieve the device connected or reconnect to it when powered.
 
Upvote 0
Top