Sorry, I may be stupid, I intended to update my tutorial this morning, but where is the updated extension??
Another point, you may wonder what the webviewer running JavaScript is for in my example. It is needed because there is still no way to convert the Ascii you recieve from the micro:bit to characters AppInventor can handle. So, if you want to display your text in your label, you better use this.
I tried this (and removed the Location permission in the Manifest) to get rid of the Location permission / request, but it doesn't seem to work (on Android 12+):
Save the AndroidManifest.xml file with above changes.
Rebuild the APK file.
NOTE:
How to view the AndroidManifest.xml?
------ Download APK Studio Editor from the link Download APK Editor for PC and Mac – APK Editor Studio
------ Open APK Studio Editor and Open the APK file.
------ Click on the "Open Contents" tab
------ Folder will be opened and "AndroidManifest.xml" file can be seen.
How to Edit AndroidManifest.xml file?
------ Open the AndroidManifest.xml using any of the text editor.
------ Delete the lines related to Bluetooth related permissions.
------ Paste the below lines and save the changes.
I confirm that it s works for me . I changed the androidmanifest.xml , exactly as you perfectly explained us, with APK studio Editor .
I delete all line with mentionned bluetooth permission and changed at the beginning with your :
Thanks for letting know about this. I'm aware you have built your own extension for Bluetooth client. I believe you have enough info and means to solve the issue. Can you please help us.
that is true Anke.
I just tried the same but with targetSdkVersion="31" instead, and the bug is there again with the pop up : "need android.permission.BLUETOOTH_CONNECT .... "
In my bluetooth client extension I introduced a method to ask for permissions like this
in my tests this was working up to now...
Taifun
/**
* RequestBluetoothPermission
*/
@SimpleFunction(description = "Request Bluetooth Permission.")
public void RequestBluetoothPermission() {
Log.d(LOG_TAG, "RequestBluetoothPermission");
if (isRepl)
{
ErrorOccurred("You will have to build the app to be able to test this method.");
} else if (ApiLevel()>30){
ActivityCompat.requestPermissions(form,
new String[] {
"android.permission.BLUETOOTH_CONNECT",
"android.permission.BLUETOOTH_SCAN",
"android.permission.BLUETOOTH_ADVERTISE",
"android.permission.ACCESS_FINE_LOCATION"
}, BLUETOOTH_PERMISSION_REQUEST_CODE
);
} else {
ActivityCompat.requestPermissions(form,
new String[] {
"android.permission.ACCESS_FINE_LOCATION"
}, BLUETOOTH_PERMISSION_REQUEST_CODE
);
}
}