techknight Well-Known Member Licensed User Longtime User Nov 18, 2019 #1 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: Code: 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?
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: Code: 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?
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2019 #2 Test it with the updated example: https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768/ It should work with all versions of Android. Upvote 0
Test it with the updated example: https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768/ It should work with all versions of Android.
techknight Well-Known Member Licensed User Longtime User Nov 18, 2019 #3 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
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.
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2019 #4 Doing complex tasks that are not directly related to the UI in the activity is a mistake. It is simpler to implement it in a class, that is initialized in the starter service. This way you don't need to deal with the activity's complex life cycle. Upvote 0
Doing complex tasks that are not directly related to the UI in the activity is a mistake. It is simpler to implement it in a class, that is initialized in the starter service. This way you don't need to deal with the activity's complex life cycle.
techknight Well-Known Member Licensed User Longtime User Nov 18, 2019 #5 Well anyways... Still doesnt work. Gets the same error. The unfiltered logs over B4A Bridge does not show anything. Upvote 0
Well anyways... Still doesnt work. Gets the same error. The unfiltered logs over B4A Bridge does not show anything.
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2019 #6 Were you asked for the location permission? Upvote 0
techknight Well-Known Member Licensed User Longtime User Nov 18, 2019 #7 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
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.
Erel B4X founder Staff member Licensed User Longtime User Nov 18, 2019 #8 Just tested here with an Android 10 and the discovery works fine. If it doesn't work on your device then there is probably a different problem. Try to restart the Bluetooth and the device. Upvote 0
Just tested here with an Android 10 and the discovery works fine. If it doesn't work on your device then there is probably a different problem. Try to restart the Bluetooth and the device.
techknight Well-Known Member Licensed User Longtime User Nov 18, 2019 #9 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
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.
Computersmith64 Well-Known Member Licensed User Longtime User Nov 18, 2019 #10 techknight said: 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. Click to expand... 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 said: 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. Click to expand... 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.
techknight Well-Known Member Licensed User Longtime User Nov 19, 2019 #11 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
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.
techknight Well-Known Member Licensed User Longtime User Nov 19, 2019 #12 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
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
L lordwest1989 New Member Licensed User Mar 31, 2021 #13 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: Mar 31, 2021 Upvote 0
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!!!!