Dear Evan, I did what you suggested, I compiled it using ai2-test.appinventor.mit.edu and I also used the fix you mentioned previously. I published a beta test version on playconsole and asked an Android 12 user to test it for me and unfortunately the error persists. Firstly, if Bluetooth is not activated, the application simply does not open, a black screen appears quickly and then disappears. I had already received this report previously, below is a printout.
To be able to open the program, just activate Bluetooth manually first, even then pressing the scan button, nothing appears in the list of Bluetooth devices, it is completely white
I think your problem lies somewhere else entirely. I made some changes/fixes. Send this link to one of your Android 12+ users to test it there (*):
Apart from that, I noticed the following:
DefaultFileScope=Legacy
FileScope=Shared
WRITE_EXTERNAL_STORAGE permission requested on all Android versions
Theme: Classic
I had to remove at least point 3 because firstly it no longer exists on Android 11+ and secondly it doesn't seem to be necessary on any Android version.
(*) Your app will not be overwritten on his device because my version has a different package name.
I sent the file to the user and we tested it via video call.
The application requested the activation of Bluetooth when opening the app and the MAC also appeared correctly in the list of devices. Apparently everything worked correctly.
I took the opportunity to test it on my Android 10, but on mine it didn't ask to activate Bluetooth (before it asked for activation), but it opened normally, I activated Bluetooth manually and it also worked.
Anke, Could you confirm if the main incompatibility was occurring with the routine for saving the MAC address in the DB and the fact that I request it to be read at startup? I am very grateful for your help and that of everyone. I have certain difficulties, but I'm interested in learning and the simple fact of being able to create my own application is very pleasurable.
I'm releasing the update on the playstore and will wait for user reports. Many Thanks!
No, the main problem was that WRITE permission was requested and that this no longer exists on Android 11+ (as I already explained). As a result, the required BT permissions were no longer requested correctly and completely (and therefore could not be granted). Furthermore, the query as to whether BT is enabled should only be made AFTER the BT permissions have been granted (at least if this query is in the Screen.Initialize event).
So build the app, upload it to your Play Dev Console as an internal test track, register your Android 12+ user as a test user and let him test this version.
correct, is that before I also requested it in "PermissonGaranted" and I was certainly wrong, as you see that you disabled the request there. But I managed to understand clearly what went wrong. I'll just wait for the publication and feedback from users and then consider the problem as resolved. Again, thank you very much!