Android Question BLE & Bluetooth Classic Issues in separate apps when running on the same device.

SJQ

Member
Licensed User
Longtime User
I have two applications running on various Android devices with varying SDK versions, so, this isn't an issue with a particular version of android.

One application uses BLE and scans for a particular set of beacons, these beacons have buttons and when pressed the name of the beacon changes for a pre-determined period then changes back to what is was originally.

Allowing passive scanning for BLE beacons and their state without connecting to them.

Other Apps like nRF Connect can easily see the changes as they occur… not the same with the B4X BLEManager2 library.

The change in the name of the BLE Beacon doesn’t register in the device found (irrespective of what scan function is used)

For the BLEManager2 library to see the change, I must start scan, look for the beacons then stop the scan, and repeat... This does work…

However, I have another app, entirely separate, and this app uses Bluetooth Classic to continuously read large amounts of data from a particular sensor.

When the BLEManager2 stops scanning it closes the classic Bluetooth socket at the same time.

Is there any way around this?

Can the BLEManager2 component register the name change without having to stop the scan?

Or is there any way it can stop scan without disrupting other Bluetooth services?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
When the BLEManager2 stops scanning it closes the classic Bluetooth socket at the same time.
There is no relation between stopping BLE scanning and classic bluetooth connections.

BLEManager2 is a thin wrapper above the native API. The source code is available on github.

The name isn't cached anywhere.
 
Upvote 0

SJQ

Member
Licensed User
Longtime User
Thanks for your reply,

No matter what I do I cannot get the BLE device name to change without stopping the scan and re-starting it... This isn't really a problem.

I've gotten over the classic Bluetooth socket closing when BLE Scan stops by setting the Target SDK to 28.

No idea why this makes a difference but it does.
 
Upvote 0
Top