Android Question Android 10 and Bluetooth Discovery

techknight

Well-Known Member
Licensed User
Longtime User
My apps are based off of the original SPP style bluetooth chat, where it reaches out and scans for bluetooth devices and connects.

I never had a problem before, until now.

When I connect via a Mac address already saved in my app, it works fine as usual.

but when I go to discover/scan for bluetooth devices, it immediately kicks out "Error starting discovery process" Which is the same exact code that was in the Bluetooth chat example.

This is new with android 10, and I use an older SDK because none of my apps are in the store.

Here is the relavant code in case anyone is curious:
B4X:
        If admin.StartDiscovery    = False Then 
            ToastMessageShow("Error starting discovery process.", True)
        Else
            ProgressDialogShow2("Searching for devices...", False)
        End If

As you can see, the admin.startdiscovery is failing for some reason.

any thoughts?
 

techknight

Well-Known Member
Licensed User
Longtime User
I will give it a try, I am curious though, Why is everything now in a BluetoothManager class? I dont remember seeing that before. All my bluetooth code is in Main.

Edit: Same thing. Error starting discovery process. It popped up with the permission request, and I hit allow all the time.

I am running an Original Pixel with Android 10.

This only started happening after the update to Android 10.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Well anyways...

Still doesnt work. Gets the same error. The unfiltered logs over B4A Bridge does not show anything.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Yes I saw it, and I agreed to it. I think Android 10 may have changed something in the API and your Serial library needs fixed, Only an assumption.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Done that 3 times now. And it worked on my device before! why not now? It has something to do with a change in Android 10. I guarentee it.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Done that 3 times now. And it worked on my device before! why not now? It has something to do with a change in Android 10. I guarentee it.
I have a 1st gen Pixel running Android 10 & I just ran an app that I haven't changed the bluetooth functionality in since I wrote it a couple of years ago & it works fine.

- Colin.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Now thats just weird. Standard or XL? I am using Standard, FWIW.

I even tried resetting the bluetooth and network settings in the device itself, and no go.
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Found the problem. It requires location to be turned on! Thats new.....

I dont want to turn the location on just to use bluetooth classic. thats stupid. My phone required it with BLE, but not BT Classic. Now it wants it for both... Grrrr
 
Upvote 0

lordwest1989

New Member
Licensed User
I have the same problem, restart, reseting doesnt help to resolve this problem.
@techknight did you resolved the problem and can you give me an advice?
Or maybe Erel can you Help me?
I tryed the example aplication that you published and it also don't work
Please help

PS: I also have upgrade android for 10 and i have Huawei p30pro

Problem resolved
I dont see that the localistation must be turned on
THANKS!!!!
 
Last edited:
Upvote 0
Top