it was just for dummy for get permission when first run.
sometimes its asking permission when the just openned first time(without any actions), but sometimes its not asking. so i made button to activate. i don't know actual condition of these differences but i guess its from minimum SDK level or just AI2<->kodular build conditions.
ofc im using as you shown for event to find devices.
the problem and my purpose is to make permission for "BLUETOOTH_ADVERTISE".
You should then place a .Connect block in a way (unobtrusive and separate from your blocks/procedures) that avoids a Connection error / ConnectionFailed.
Hello,
I have read 4 threads regarding the connection issue which is from the latest version of AppInventor.
I worked on a mini program on Feb 15, 2023 which worked perfectly. Today it shows the error message:
" Need android.permission.BLUETOOTH_SCAN permission for AttributionSource { uid = 10267, packageName = edu.mit.appinventor.aicompanion3, attributionTag = null, token = android.os.BinderProxy@76115b5, next = null }: AdapterService isDiscovering "
I tested the same mini program on the AppInventor beta version the message is identical.
I also added the extension :
Bluetooth Low Energy
Extension Version: 20230223-beta
Date Built: 2023-02-23
=> Same error message. I'm at an impasse.
I tested your app apk and put the result without the other thread.
Regarding the bluetooth problem with Android 12, how can we get around the blockage?
This work is a school project and I have to find a solution to overcome this dysfunction.
I tested the application with an old tablet under Android 4, same error. What workaround can we use please?
Phone model:
Xiaomi 12T Pro
Miui 14
Android 13
Problem: it can scan for devices, but won't connect. tried connect with index and connect with mac.
errors: "Connection timeout", "connection status was set to OS code 4"
Phone model:
Xiaomi Mi6
Lineage
Android 10
Problem: it can scan for devices, but won't connect. tried connect with index and connect with mac.
errors:
"Connection timeout", "connection status was set to OS code 133"
version 20201223 here is binding on both. I haven't tested sending and receiving data yet.
Here is an updated beta version of the BluetoothLE extension. Unfortunately I haven't had a chance to test this on an Android 12 device yet, so make sure to back up your projects before you upgrade.
Which gets me either this error:
Attempt to invoke virtual method 'android.bluetooth.le.ScanRecord android.bluetooth.le.ScanResult.getScanRecord()' on a null object reference
Note: You will not see another error reported for 5 seconds.
Or "null" is updated in the text.
The deviceAddress should be the one for another phone of mine or a laptop I have here, and the serviceUUID is the one in an advertiser I'm using in the "nRF connect" app.
I can provide more information to help troubleshoot.
I see the command I'm using is call BluetoothLE.AdvertisementData, but some BTLE apps call that field (or a related one, I'm just learning about this as I go) as "ManufacturerData". Hope they both refer to the same field. This is an example C# BTLE app from Microsoft which does that