I did had a try with the :
BLE-with-extensions-api.aix
and
edu.mit.appinventor.ble-20200828.aix (latest release available)
Hi lenoyl
The Android 10 provisions do not apply to Android 9. Android 10 has many differences including a new collection of Google Security Measures which are the main "issue" for App Developers, including working with Bluetooth.
What is the Manufacturer/Model of your tablet?
Hi Chris,
it is the K107 Beista tablet with android 9.
I precise that the tablet is paired with the device, that is not the issue, just that it doesn't show up in the list with app inventor after the scan...
Any possible work around?
regards,
According to the manufacturer's specs, it's Android v5.1 Lollipop? It's pretty well guaranteed that you can't update from 5.1 to 9.
If it is Android 5.1, it just scrapes into the realm of BLE:
App Inventor BLE requires your device (e.g. SmartPhone) to have Android v5.0 or higher to avoid known issues with Google's Bluetooth LE support prior to Android 5.0.
The spec says it has Bluetooth v4.0, the very first version of BLE, first released in 2010, the most problematic version of BLE unfortunately.
The latest MIT BLE extension is the way to go. However, if it got into your Project as an update rather than being the very first version you used, the update may have silently failed. What to do:
- Save a backup of the Project to your PC
- Ensure the BackPack is empty
- Right-mouse click "Copy All Blocks to Backpack"
- Right-mouse click "Delete n Blocks" - App Inventor will have a panic attack and ask if you want to "Save the empty screen now" - yes you do.
- Go to the Designer, delete the Bluetooth Extension via the Extension Palette. App Inventor will have another panic attack and warn that all associated Blocks will be deleted too. The answer is OK.
- Import extension edu.mit.appinventor.ble-20200828.aix
- Return to the Blocks workspace, Right-mouse click "Paste All Blocks from Backpack"
Hi Chris,
Thx for your time to help me.
I confirm it is the K107 Beista tablet with android 9 on it (I checked - don' t ask me why and how they managed to do that...)
Will have a try with your procedure and will get back to you shortly.
I just had a try with the procedure, doesn t work. I also tried with a new simple small project from scratch with the edu.mit.appinventor.ble-20200828.aix release (see aia file enclosed)BLE_android9_test.aia (189.8 KB) . on my android 6 smartphone I can see the ble device but not with the android9 tablet
Any other idea?
Do you receive regular Android 9 updates? There has been at least five this year.
hum ... it says that the system is up to date when I check for update .... but latest the update version looks suspicious:
BEISTA_vXA400009_20200106_20200106-2042
I suspect that the Android Version has been faked. However, for the purposes of your App, hopefully that should not matter.
I have just butchered some code I wrote for another AI2 User last night, for you to test. It must be tested as an APK, not via the Companion. It works for the other User but I have no Android v9 devices to test with today (house undergoing some renovations!). I have tested on v10 and it works.
Tips
- Do not run from the finished install panel displayed, run via the App Icon.
- If an eligible device is within 2-3 metres of your phone/tablet, it probably won't be found (Bluetooth flaw).
BleListDevices.aia (195.4 KB)
ok, I will let you know soon I have tested it.
thx,
Morning Chris,
I just tested your .apk: it just return me '' no device found'' and that's it! (I tested it with 10m between me and the BLE device...)
Assuming the Android version has been faked (most likely case) and it s running on a android 5.1: as you mentioned it is just at the start of the BLE era, has some one part of a BLE code that I can test knowing that is was working with a 5.1 Lollipop?
All these examples are tested on Meizu m3 note with Android 5.1 and Xiaomi Redmi 7 with Android 9
Hi lenoyl
It is well worth trying Juan's BLE example, he is an expert on this stuff.
It might be a good idea to try Classic BT too. You can try my Project here (near the end of the posts):
...which uses a Clock Timer to give BT a bit of time to complete it's scan in a similar way to my BLE example.
Hi guys,
Thx Juan for your help (I know KIO4 website and found some interesting stuff like the vertical slider ... just a pitty that there is no way to set the slider thumbposition to a certain value by pushing an other button - I finally found some in using Kodular- but anyway your website was really helpfull!)
Back to the problem: I had a try with Juan .aia and there is no list showing up with the BLE device after the scan. By the way I did try to compile it (to run a test without the compagnion), but get a long error message ....
Looks like I m going to have a try with an HC-05... I just got them few days ago.
Anyway, guys thx for your help and your time, we didn't manage to succeed this time, but maybe next one!
Hi lenoyl
It would help us if we could see that error message.
I had the same problem and realized I didn't have location turned on. Once I switched "location" on, the Bluetooth list showed with Android 9.
Good evening,
I confirm what Christophe_Tressler just said, you just need to authorize access to the position.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.