No devices found during BLE scan on android 10

Hi,
all my old BLE projects don't go on android 9 and up.
Which is the right procedure?
I've tried the new version of BLE extension, I've activate Location services, but when I click on Scan no devices are shown.
When I call the "BluetoothLE.StartScanning" the "BluetoothLE.Scanning" remains always false.
Thank you.

SOLUTION:
Screen1.initialize > Call Screen1.AskForPermission > "android.hardware.bluetooth_le"

Hi there,

I have the same problem. I tried a.m. solution. However when I add the request for permission it tells me that the request is denied. I have to grant access in the Android settings. In the settings location-access is granted while app is in use. It's the same location-right-setting as I have for other BLE-apps: For instance "nRF Connect" or "LightBlue" are detecting plenty of BLE-devices and they have the same location-right-setting. Thus it sounds for me that it is a problem linked to the MIT App Inventor and Android 10. If I run my app on another mobile with Android 8, everything works fine.

Any help is appreciated.

Thanks

Frank

Yes, also me it tells that the request is denied, but BluetoothLE.StartScanning go well and find all rhe BLE devices.

Another problem is that I have tried on a wear os watch but the BluetoothLE.StartScanning doesn't go well and rhe devices list remains blank.

Does anyone know if this error has already been fixed? I have the same problem and it must have been some update of AppInventor since an .apk from a few days before with the same code if it works and the new builds do not.

This doesn't work for me. I just get a popup saying permission to android.hardware.bluetooth_le was denied. Galaxy Note 9.

Did you enable the permission using the Android Settings?

Something like: Settings>Apps>Select the name of the app you installed >Permissions and there might be an option for BlueTooth.

You could try that after building the apk and installing your app on the device.

Will it work? Perhaps, try it. For example: go to Settings, find your program under Apps and then set the permission.

I looked at the permissions for my app and there isn't any for bluetooth. The app asks for location access, to which my options are deny or allow while using the app. That's it. I tried toggling the location permission to deny and back to allow while using the app as I read that can fix a bug in Android 10 related to this but that didn't work either. I have location services on as well. Everything that needs to be on and set correctly seems to be and everything worked before the latest updates to AI2 and Android 10.

The behavior is the same regardless of compiling and using the .apk or using the AI2 Companion loader.

I completely agree. It seems that MIT App has recently updated their IDE which most likely caused this problem. Although it is not clear, if it is intentional or a bug.

I am creating a BLE app for Android10. And I have built a .apk file last July 17th which was able to scan and display discoverable devices perfectly. Today, I tried to re-build the same project, unfortunately it cannot scan nor display any available devices anymore. But if I re-install the .apk (BUILD:July17th), it works normally.

Guys,

The "andriod.hardware.bluetooth_le" below did not help my case...

Fortunately this one did...
I updated the BLE extension.

  • BEFORE: edu.mit.appinventor.ble-20190701.aix
  • AFTER : BLE-with-extensions-api.aix
    ※ version from Mr.Evan...
    ※ no need to incorporate the "andriod.hardware.bluetooth_le"

See below for the discussion thread...

2 Likes

Hi donatz,

worked perfectly for me. Apparently this is an upgrade of the BLE-extension to status of 2020 June. Before the extension I used had status 2019 July.

Thx and BR

Frank

I can confirm this BLE extension 20200616 works on my Note 9 again.

@ewpatton
Is the BLE extension going to be updated to 20200616 at this thread, or did I miss where its officially supposed to be released?

Thanks guys, now I can get on with my project. Love this community and your help!

1 Like

This update fixed the issue I was having with my S9 connecting to the BLE module, I knew the app was working because I could use it on my lenovo tablet.

:+1:

Updating the IOT site with the new version is on my (very long) to-do list. However, the extension isn't quite feature complete internally. For end users it should be sufficient but there is internally a not yet complete API that extension developers can use to build on the BLE extension that I'd like to finish first.

1 Like

Hello,

Sorry, but for me on Android 10 and try will many aix files on 4/july 2020 and the 16 june 2020, same issue. impossible to scan any ble devices. Nothing works even with this very simple program

ble

The liste_ble never goes to visible?
So there is a issue with your extension even with your compilation.
Because when I use a very old apk already compiled with an alod 2018 aix, it works on my android 10.
But now, with the same aix program, I try to compiled with with no modification, I create the same apk, But this apk doesn't works, no scan?
And if I try to rebuild with the new extension
http://iot.appinventor.mit.edu/assets/resources/edu.mit.appinventor.ble-20190701.aix
or this one
BLE-with-extensions-api.aix

But no aix extension works to scan devices.
So please help me and give me a very simple example to scan devices.
What I realy don"t understand, is it was working very well on the previous 2018 dec version.

I even try to connect straight with connectwithaddress, same issue, not working? So yhanks to help.
ble
Your sincerely.

Julien

1 Like

This is a very simple app that works for me on Android 10. Starting with Android 10, apps that do BLE scanning need to request fine location permission, otherwise no results will be returned. If you have location services turned off or deny permission, you won't be able to scan. Tested on a Google Pixel running Android 10.

Android10BLETest.aia (187.3 KB)

Unbenannt
Unbenannt2
(screenshots added by Taifun)

1 Like

Hello,

very thanks to help me. I really don't understand, because with your program al is ok.
I try to make a new program from scratch and it works now.
Inbetwwen I start NMEA tool to ask GNSS of the smartphone to read the GPS. SO perhaps we need to update our GNSS position? realy don't understand??

Could you give me the right link to upload the last AIX extension for BLE.
Could you update it on your website on the link here
http://iot.appinventor.mit.edu/#/bluetoothle/bluetoothleintro
It not seems to be the same extension? I am not using this one. I use the 2020-06-16 version.
So could you put the good extension.

Could you tell me when appinventor for IOS will be available?

Very thanks to help us.
Your sincerely.

Julien

Hello,
could you tell me if the right wait to connect to a ble are these steps?
http://iot.appinventor.mit.edu/assets/tutorials/MIT_App_Inventor_Basic_Connection.pdf
Best regards.

Julien

Hello,

I try to scan BLE devices. But, no devices scanned?
I use your last version 20-06-16 aix extension ble.
I don't understand, but when I use a old apk done with 2018 ble aix, it works. But When now I use the same program, but I try to compile now with the same aix source file with 2018 aix version, the new apk doesn"t scan the ble devices? So they my have issues with your new compilation?
Could you help me please.
Regards JL

I even try with the method connectwithaddress and mac address, but can't connect to the ble device? But works perfect with nrfconnect?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.