Android Question B4A App runs fine with Android 5 will not run with Samsung phone running Android 10

fredeady

Member
Licensed User
Longtime User
I'm missing something.. So, I decided to reach out.. I have a B4A/BLE app that runs like a fine sewing machine on a cheap WalMart LG phone running Android 5.1.1.
Try to run the very same app on a Samsung S10 running Android 10 and it refuses to connect via BLE. I've checked all of the usual suspects (non-Google Play apps can be installed, BLE activated, B4A Manifest SDK versions, Nordic forum, etc.). I've also searched this forum for clues.

The BLE target is a Nordic nRF52832. I'm running the latest spin of B4A. I am replacing a previous non-B4A Android app that did not run on the Samsung S10 correctly (same issue as I am having).
Are there any B4A Samsung S10 "tricks" that I am not using?

Thanks in advance for any direction or support anyone can give.
 

Computersmith64

Well-Known Member
Licensed User
Longtime User
Without you posting your code, logs, etc... it's impossible to say. A lot has changed between Android 5 & Android 10 so it's possible that whatever BLE library you're using in your app hasn't been updated to take those changes into account.

- Colin.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
Try to run the very same app on a Samsung S10 running Android 10 and it refuses to connect via BLE.
what is the error?
Do you have fine location ON?

look this:
 
Upvote 0

fredeady

Member
Licensed User
Longtime User
HI, Thanks for the replies.. I do realize you need more info. My post is kinda a fishing post to see if anyone else with this same experience had any suggestions I could throw into the code and try. You don't have logs because the customer has the phone.. He's in Idaho and I'm in Georgia. I don't have a Samsung S10 in the shop to try to replicate their problem.. I developed the app using a WalMart phone I had here in the shop.

What I can answer is that fine location is ON. And, I'm using the B4A BLE2 library. This isn't my first rodeo with BLE. So, I'm confident that my BLE code is OK as I've used it before.

I'll get my hands on a (hopefully) cheap Android 10 phone and get back to work on this problem. If I can't figure it out, I'll post again with something that you can use to help me get out of this box. I've seen you folks help others with great success.

Thanks to you that replied. If I get lucky, I'll post the solution.
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
HI, Thanks for the replies.. I do realize you need more info. My post is kinda a fishing post to see if anyone else with this same experience had any suggestions I could throw into the code and try. You don't have logs because the customer has the phone.. He's in Idaho and I'm in Georgia. I don't have a Samsung S10 in the shop to try to replicate their problem.. I developed the app using a WalMart phone I had here in the shop.

What I can answer is that fine location is ON. And, I'm using the B4A BLE2 library. This isn't my first rodeo with BLE. So, I'm confident that my BLE code is OK as I've used it before.

I'll get my hands on a (hopefully) cheap Android 10 phone and get back to work on this problem. If I can't figure it out, I'll post again with something that you can use to help me get out of this box. I've seen you folks help others with great success.

Thanks to you that replied. If I get lucky, I'll post the solution.
I had a client with similar error: "the app can't connect to my Android "
solution: reset the Android Phone

In my case using nRF52840

good to look this:
 
Last edited:
Upvote 0

fredeady

Member
Licensed User
Longtime User
Thanks for the positive responses.. I'll perform all of the suggestions and get back with y'all (that's Southern for you all)...
 
Upvote 0

fredeady

Member
Licensed User
Longtime User
HI, Everyone
Making some progress..

f0raster0, I did not verify if customer has reset his phone.. Will do that this evening... My nRF52832 code MIN_CONN_INTERVAL vals are OK as per the forum entry you referenced.

Erel, the latest BLE Example app loads and runs on the S10.. Customer tells me he is getting "An app is needed to use this device" message..

agraham, judging from the "app needed" message, sounds like you're onto something with permissions.. My B4A code is using RunTimePermissions just as the latest BLE Example Erel asked me to attempt to run is doing. My Manifest matches the latest BLE Example Manifest.

I'm thinking the S10 is the problem and not the B4A code. I'm also thinking the S10 has a permission problem.
Suggestions and direction are welcomed. I don't have a problem with posting any of my code. So, just ask for the portions of my code you want to take a look at.

Again, thanks to everyone involved and helping me with this problem. I really appreciate your responses and insight.

Keep them dogies rollin', Rawhide!!
 
Upvote 0

f0raster0

Well-Known Member
Licensed User
Longtime User
can you send a demo to your client? if yes,
then download the last version of the demo from Erel's link, it includes all the permissions, and send that demo to your user using S10 to test it for you.

Edit:
I have S9 and S10, and also nRF52832 and nRF52840, if you like I can test your App here.
 
Last edited:
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Hello,

It seems I have the same problem. I have a device EBYTE E104-BT40 BLE Bluetooth , it works fine with B4i (iPhone), and with Samsung Android 4.4, but not with Samsung S10 Android 10.

It "Disconnects" just after the connection. I have try with the APP "BLE Scanner", and the Samsung S10 connects fine to the device with this App.

Thanks.

log Samsung S10 Android 10:
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Found: , 27:EA:16:2B:65:14, RSSI = -26, (MyMap) {-1=[B@4dd1721, 0=[B@3b51746}
Found: , 72:3B:A9:F4:B4:8E, RSSI = -55, (MyMap) {1=[B@7566d07, 10=[B@f6ebe34, -1=[B@53045d, 0=[B@b9b61d2}
Found: ALFANO-0BLE , EA:B6:0B:B7:3A:F0, RSSI = -38, (MyMap) {1=[B@362d2a3, 2=[B@a5389a0, 9=[B@b408959, 0=[B@829c91e}
Disconnected


log Samsung Tab 3 Android 4.4:
Logger connecté à : 43007c0e3c8750b1
--------- beginning of /dev/log/system--------- beginning of /dev/log/main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Found: , 27:EA:16:2B:65:14, RSSI = -58, (MyMap) {-1=[B@42837520, 0=[B@42835148}
Found: KRONOS-1135 , EA:B6:0B:B8:1A:C5, RSSI = -53, (MyMap) {1=[B@428392b0, 2=[B@42839228, 9=[B@42839268, 0=[B@42838ce8}
Found: ALFANO-0BLE , EA:B6:0B:B7:3A:F0, RSSI = -52, (MyMap) {1=[B@4283b358, 2=[B@4283b2d0, 9=[B@4283b310, 0=[B@4283add0}
Discovering services.
 
Upvote 0

fredeady

Member
Licensed User
Longtime User
Hi, f0raster0
I sent Erel's BLE Example and he loaded it but got the "app needed" message.
I appreciate your taking the time to look at this for me. Another set of eyes is always good.
How should I get the code to you? I have a Google Drive. So, I can "share" it with your if I have your email address.

Thanks for the offer and the help.
 
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Hello,

Below the unfiltrer log with Android 10 :

Do you know why BLE disconnect please?

Thanks for your help.

B4X:
ViewPostIme pointer 0
ViewPostIme pointer 1
Class androidx.core.content.ContextCompat failed lock verification and will run slower.
startLeScan(): null
STATE_ON
uid=10282(b4a.bbb) identical 1 line
STATE_ON
BLE support array set: 111111
Start Scan with callback
onScannerRegistered() - status=0 scannerId=8 mScannerId=0
Relayout returned: old=(0,0,1080,2280) new=(0,0,1080,2280) req=(1080,2280)0 dur=4 res=0x1 s={true 486227451904} ch=false
Found: ALFANO-0BLE, EA:B6:0B:B7:3A:F0, RSSI = -62, (MyMap) {1=[B@8c114fe, 2=[B@90f845f, 9=[B@66a7eac, 0=[B@2f88775}
Found: KRONOS-1135 , EA:B6:0B:B8:1A:C5, RSSI = -56, (MyMap) {1=[B@695830a, 2=[B@f52077b, 9=[B@856d998, 0=[B@6d725f1}
tentative de connection : KRONOS-1135
stopLeScan()
STATE_ON
STATE_ON
Stop Scan with callback
Found: , 19:95:F9:25:8F:1F, RSSI = -50, (MyMap) {-1=[B@90c5d6, 0=[B@36fa057}
Found: , 64:31:AF:E0:77:C1, RSSI = -32, (MyMap) {1=[B@3abf744, 10=[B@827302d, -1=[B@92b6962, 0=[B@563eaf3}
Class anywheresoftware.b4a.objects.BleManager2$GattCallback failed lock verification and will run slower.
STATE_ON
connect() - device: EA:B6:0B:B8:1A:C5, auto: false
isSecureModeEnabled
registerApp()
registerApp() - UUID=1cb67b2e-e153-4987-851f-d1fe5f296c8e
onClientRegistered() - status=0 clientIf=8
onClientConnectionState() - status=133 clientIf=8 device=EA:B6:0B:B8:1A:C5
close()
unregisterApp() - mClientIf=8
Disconnected
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
I could be wrong but it seems BT is sort of 'broken' on Android 10, but I can tell you that on 11 it is, my old phone, a Pixel 4XL worked like a charm connecting to BT in my car, I got the Pixel 5 and BT is funky, it connects to my car but I can only control the volume, I can't control the media like next track, previous track, and one more thing, even though it is connected and I can listen to my awesome tunes via BT in my car, the car reports: No device connected.

Perhaps an unrelated issue to this thread but I believe is a little relevant since we are talking BT here.
 
Last edited:
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
It is strange, on this same phone Samsung S10, Android 10, the APP "BLE Scanner" works fine and I can connect with success...
 
Upvote 0

Arnaud

Active Member
Licensed User
Longtime User
Hello,

I have found more information about the error log with Android 10.

It seems there is link with the GATT. Can I do something to resolve this?

Below the unfiltrer log with Android 10 :

Thanks for your help.

log Samsung S10:
Found: ALFANO-0BLE, EA:B6:0B:B7:3A:F0, RSSI = -66, (MyMap) {1=[B@695830a, 2=[B@f52077b, 9=[B@856d998, 0=[B@6d725f1}
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
 
tentative de connection : ALFANO-0BLE
 
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
stopLeScan()
STATE_ON
STATE_ON
Stop Scan with callback
remove() - id: 5
remove() - removed: 5
btm_ble_disable_resolving_list() rl_state = 0x18, rl_mask = 0x2, to_resume = 1
btm_ble_disable_resolving_list() rl_state = 0x18, rl_mask = 0x2, to_resume = 1
[GSIM LOG]: gsimLogHandler, msg: MESSAGE_SCAN_STOP, appName: b4a.bbb, scannerId: 5, reportDelayMillis=0
preload pkg: [com.google.android.gm] type: ml
Sent pkg = com.macdom.ble.blescanner type: ml
[ML] packageName : com.macdom.ble.blescanner uid : 0 type : ml
[ML] This Package is on the Memory
FrequencyrequestList.getNextSchedTuneBoostRequest, index: 0
!@   8,0 r 115802 7874976 w 182274 4574216 d 24315 110679604 f 60874 83796 iot 143136 116506 th 102400 0 0 pt 0 inp 0 0 16363.026
!@Sync: 545 heap: 63 / 80 [2021-01-05 10:29:14.754] sdogWay: softdog
identifyGamePackage. b4a.bbb, mCurrentUserId: 0, callerUserId: 0
getGamePkgData(). b4a.bbb
Class anywheresoftware.b4a.objects.BleManager2$GattCallback failed lock verification and will run slower.
STATE_ON
connect() - device: EA:B6:0B:B7:3A:F0, auto: true
isSecureModeEnabled
isSecureModeOn:false
registerApp()
registerApp() - UUID=8d4b7b55-5bb1-4bba-aeab-35b8335f7477
registerClient(b4a.bbb) - UUID=8d4b7b55-5bb1-4bba-aeab-35b8335f7477
add() - appUid: 10282, appPid: 26893, appName: b4a.bbb
[INFO:gatt_api.cc(958)] GATT_Register 8d4b7b55-5bb1-4bba-aeab-35b8335f7477
[INFO:gatt_api.cc(995)] allocated gatt_if=5
onClientRegistered() - UUID=8d4b7b55-5bb1-4bba-aeab-35b8335f7477, clientIf=5
onClientRegistered() - status=0 clientIf=5
clientConnect(b4a.bbb) - address = B7:3, isDirect=false transport =0 set own addr = false own addr type:0, clientIf: 5, opportunistic=false, phy: 1
BTM_SecAddBleDevice: dev_type=0x3
[ERROR:gatt_api.cc(1150)] GATT_Connectgatt_if=5, address=ea:b6:0b:b7:3a:f0
[ERROR:gatt_api.cc(1160)] Unsupported transport for background connection
[ERROR:bta_gattc_act.cc(416)] bta_gattc_init_bk_conn unable to connect to remote bd_addr=ea:b6:0b:b7:3a:f0
onConnected() - clientIf=5, connId=65535, status=133, address=B7:3
onClientConnectionState() - status=133 clientIf=5 device=EA:B6:0B:B7:3A:F0
close()
unregisterApp() - mClientIf=5
unregisterClient(b4a.bbb) - clientIf=5
remove() - id: 5
remove() - removed: 5
[ERROR:gatt_api.cc(1213)] GATT_CancelConnect: gatt_if:5, address: 00:00:00:00:00:00, direct:0
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
 
Disconnected
 
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
--------------------
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Ok, after a little bit of research, I fixed the problem I had on my post above, it seems Android 10 and higher defaults to newer BT profiles, in my case it was using AVRCP 1.5, when I selected AVRCP 1.4 worked as expected.

If you are wondering where to get those settings you will have to look under DEVELOPER OPTIONS -> BLUETOOTH AVRCP VERSION, there are also other BT settings there but I don't know if that will apply to your needs.
 
Upvote 0

fredeady

Member
Licensed User
Longtime User
Hi, Everyone
Just got a brand new Samsung A11 running Android 10. The original code I had "problems" with works just fine on the A11 .. Nothing in the original code was changed.
I used the tools put forth in Erel's latest BLE example code and it all works as designed. Now, is there something odd about S10 phones???????
Thanks to everyone that chimed in on this.
 
Upvote 0
Top