Hi.
I have a curious problem using BLE with Android 7 & 8.
Mi app worked for years in versions 6 and lower of Android, and with Bluetooh 3 and BLE. Allways without problems.
I introduced the necessary modifications to run Android 7 and 8.
Manifest:
It produces a curious effect ONLY running in a device with Android 7 (and 8 I suppose)
After scanning, the Manager_DeviceFound is fired correctly
But Immediately after Connect2 (and Connect also), the event fired is Manager_Disconnected
(instead of Manager_Connected)
If I run the app in a phone with Android 4 or 5, all is working perfect.
And I don’t know how to manage this. Any idea?
I’m using B4A 8.0 and BLE2 V 1.36
Thank you very much
I have a curious problem using BLE with Android 7 & 8.
Mi app worked for years in versions 6 and lower of Android, and with Bluetooh 3 and BLE. Allways without problems.
I introduced the necessary modifications to run Android 7 and 8.
Manifest:
B4X:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="27"/>
AddPermission(android.permission.ACCESS_COARSE_LOCATION)
AddPermission(android.permission.ACCESS_FINE_LOCATION)
B4X:
Sub Activity_Create(FirstTime As Boolean)
rp.CheckAndRequest(rp.PERMISSION_ACCESS_FINE_LOCATION)
....
end sub
Sub Activity_PermissionResult (Permission As String, Result As Boolean)
Select Case Permission
Case rp.PERMISSION_WRITE_EXTERNAL_STORAGE
If Result Then
ToastMessageShow("Permission OK",True)
End If
Case rp.PERMISSION_ACCESS_FINE_LOCATION
If Result Then
ToastMessageShow("BT Permission OK",True)
End If
End Select
End Sub
It produces a curious effect ONLY running in a device with Android 7 (and 8 I suppose)
After scanning, the Manager_DeviceFound is fired correctly
B4X:
Sub Manager_DeviceFound (Name As String, Id As String, AdvertisingData As Map, RSSI As Double)
If Id=Starter.StoredId then
manager.Connect2(Id,False)
end if
end sub
But Immediately after Connect2 (and Connect also), the event fired is Manager_Disconnected
(instead of Manager_Connected)
If I run the app in a phone with Android 4 or 5, all is working perfect.
And I don’t know how to manage this. Any idea?
I’m using B4A 8.0 and BLE2 V 1.36
Thank you very much