Android Question BluetoothAdmin sync

umberto_dev

Member
Licensed User
Longtime User
Hello, I have some troubles when I try to scan several BT devices.
First of all, the time it takes to begin the scan seems unpredictable. Sometimes it's almost immediate, sometimes it takes a long time. It doesn't depend on other activities.
Last week I noticed both on my phones and tablets that when I begin to scan the BT on Settings, they recognise Mac addresses at first and then the names.
So my questions are:
- is it possible to start scanning without delay?
- is there a way to manage Admin_DeviceFound when I intercept the mac address, before the full association (Name and MAC)?
Thank you very much for any help.
Umberto
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

umberto_dev

Member
Licensed User
Longtime User
Thank you very much, Erel.
I gave a look at the library XML. The DeviceFound event has two arguments (Name As String, MacAddress As String).
I think that it returns values only when and if both are found. As I wrote it seems that Android makes a mac address search first and then then the friendly name. Is there a way to override it and get the MacAddress only? This way I shouldn't have to wait for the whole process to be performed and I could count the number of devices found faster.
Thank you again for your precious help.
Umberto
 
Upvote 0

umberto_dev

Member
Licensed User
Longtime User
On Settings (Android Settings). When I start to search for devices it returns almost immediately their MAC addresses, and after a while (about half a minute) it shows the friendly name. It happens both on three smartphones and 2 tablets (several Android versions). If I use BT4 devices, instead, the search is almost immediate and names appear immediately too.
So I was thinking that if I can extend the class and override the method (or event) I could skip the name association, since I really don't need it.
Do you have any idea?
Thank you very much.
 
Upvote 0

umberto_dev

Member
Licensed User
Longtime User
Don't know. Since it returns the mac address, a generic bt symbol, and then the name and a proper icon.
I'll try another way and I'll let you know.
Thanks a lot.
 
Upvote 0
Top