Bluetooth list picker does not work with Samsung

Hi all,

I am creating app which communicate with ESP32. So in first everything was okey and app worked, but after installed new android 10 security patch 2020 02 update, suddenly app won’t communicate at all. I am using Oneplus 6 phone. So I suspect that new security patch does’t allow to communicate with BLE extension 20181124 version. The older phone with older android can communicate without any problems.
I guess you have the same problem.

That is perhaps possible, but if that is really the problem, I can not fix them until the extension will be updated.

Ewpatton give direction to github with java files. So I sneak in and try to find something. And in BluetoothLE.java file, 73 line where you can fine userpermissions, “@UsesPermissions({ BLUETOOTH, BLUETOOTH_ADMIN, ACCESS_COARSE_LOCATION })”

Access_coarse_location is good for ANDROID 9 and lower, and for ANDROID 10 you need declare “ACCESS_FINE_LOCATION”. I do not know it’s a big deal, but when you developing in android studio in manifest you must declare that.
https://developer.android.com/guide/topics/connectivity/bluetooth-le#java

Maybe I can change that by myself, but I do not know how to everything put in AIX format. Afcorse, you can open AIX file with simple winRAR or 7-zip and extract all java files.

That is a great information! Thank you very much!
I have tried to open the .aix file with 7-zip, but there are only .class files in the .jar files. It has two .jar files. But no .java files in there. One of them is called classes.jar and the other is AndroidRuntime.jar.

If one of the MIT members will fix it for future use would be great! Or if you, Justinas_Krauleidis, can make a .aix file to try it.

Hi,
I have the same problem and not being a ITer, all this info is too difficult for me.

My solution is maybe too easy but it works for me on a Samsung S8.
I just allowed the phone to communicate with other devices in the Bluetooth menu, and then the listpicker in my own program works fine and recognizes my ESP32 board.

Hi,
I had the same problem with my new Samsung Galaxy XCOVER 4S.

My app working with BLE module (HM-10) worked fine with Samsung Galaxy S7, S9+, Sony Xperia Z3, Z5 Compact.

XCOVER 4S was problem.
After reading this thread, I just tried to check if location feature in setting is enabled. It wasn't. Turning it on lead to devices appear in list:

Settings -> Location -> Turn on (slider)

After that, I got list of BLE devices in my AI2 app.

I was testing the app on new phone so I newer enabled the location before.

The Xperia Z3 (Android 6.0.1) behaves the same way - it just came to me with the location service already turned on in settings. If I disable the location, I am unble to list devices...

I hope this helps you.

I've got the same issue with my Note 9. Android 10, latest BLE extension and AI2. Doesn't show the list of devices. I've tried everything I have managed to find as a suggestion. I think somethings broken from a recent update.

Dear all,
There's an upgrade of the BLE extension dated July 2020. With this update everything worked fine. Checkout this thread, there'll find the link: No devices found during BLE scan on android 10
BR
Frank

That are great news! I will try it out! Hope to find some time for changing the extension soon in my apps to try it...

I have same problems with Xiaomi then reset conections and fix it. Thank you.

Hi, I tried everything you advised I have the latest version 20200828 I tried older but Samsung does not work! Is there any shift in this issue?

Can you tell us more about what you're trying to do? Does it work with a very simple app? What version of Android is your phone running? What BLE extension version are you using? Are location services turned on and did you grant permissions to the companion app while testing?

I was having the same problem. But I saw that there is a more current version of BLE (20200828), and here it worked.

That was really a very good information! My old phone asked automatically to turn on the location feature. My new Samsung does not asked. As I have take a look at this, in settings - location, I had to enable it and now the BLE devices appear in the list! Great we could that get working :slight_smile:
A big thanks to all who have helped here to find a solution! At the beginning I meant I was the only one who had this problem!

You can display a reminder like so:

That is a good point! Better than nothing, but the function to ask and turn it on or disagree (same as the bluetooth connection) was very nice on my old phone. If bluetooth is turned off it askes too to turn it on with a little window.

We can turn on Bluetooth programmatically (note the Procedure 'ProcIsBluetoothEnabled') via an Activity Starter, but have not found a way to do the same with location - possibly intentional on Google's part, as a security measure.

You can use my extension to check if service location is turn on, and opene settings of location services using ActivityStarter.

ble_test_app.aia (199.9 KB)

Thanks for your solution! I have solved it this way now. That is the best way to make it working for me: