Android Question Ble in Android10(B)

Tomas.yong

Member
Licensed User
Hello
My Ble4.2 test demo runs very well in Android 6. But Host can not connect with device in android 10. B4A ver is 9.01 and Ble Lib is v1.38. Probably i need to updata android SDK, but i don't know how to do. Very thanks for your help.
 
Last edited:

f0raster0

Well-Known Member
Licensed User
Longtime User
what module bluetooth are you using?

asking just in case, after testing with Android 6 your module bluetooth is fully unconnected from your Smartphone with Android 6 before testing with your Android 10?
 
Upvote 0

Tomas.yong

Member
Licensed User
In Android 6, The two event:Manager_DeviceFound() And Manager_Connected() is very OK。
In Android 10,The first step Manager_DeviceFound() is failed means Center can not find Ble device。
 
Upvote 0

Tomas.yong

Member
Licensed User
Erel
I try the uper code again and again but the result is same: Cann't find Ble device. At the same time, the result is very beautiful to send/receive date test in android6(period 200ms/during 2 hours, no frame lost).
 
Upvote 0

Tomas.yong

Member
Licensed User
No any response in android 10. I decide to give up,thanks a lot.
Public Sub StartScan
If manager.State <> manager.STATE_POWERED_ON Then
ToastMessageShow("请打开手机蓝牙...", False)
Else If Starter.rp.Check(Starter.rp.PERMISSION_ACCESS_COARSE_LOCATION) = False Then
ToastMessageShow("无定位许可...", False)
Else
manager.Scan2(Null, False)
End If
End Sub

Private Sub Manager_DeviceFound (Name As String, DeviceId As String, AdvertisingData As Map, RSSI As Double)
If Name="超靖界AEB" Then
ToastMessageShow("发现蓝牙设备 - "&Name, False)
manager.StopScan
manager.Connect2(DeviceId, False)
End If
End Sub
 
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
You also need to make sure your Location is turned on, on your device. I have noticed this on my Pixel, otherwise it wont pick up any BLE devices.
 
Upvote 0
Top