You won't find a more simple way to code than with App Inventor! No matter what coding language you use, you need a bit of patience and persistence to reach your goal. We have developers from the age of 6 to 96 using App Inventor. The only secret is to define your App GUI on paper first and write down the sequence of events needed to achieve your requirements.
The most complicated issue that you have faced is getting the permissions correct. This is an Android security measure, any coding language used to make an Android App has to satisfy these requirements, not just App Inventor.
I have been writing code for more than thirty years. z80 assembler, PIC. Arduino 6502 etc. I know about persistence but App inventor currently does not play nicely with Android, the job it was supposed to do. I'll leave it. My time is worth too much to me to use another four days failing to connect a telephone to an ESP32. It just ain't worth the bother. When the tool becomes a labour making device, the wise man cuts it up and burns it to avoid wasting more time with it.
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.
To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.
Thank you. That seems more useful! But it isn't because it just gives a 515 error when tried, even if it is fully uninstalled and the whole pairing process started again.
If you'd like to participate, we are investigating how to improve the BluetoothClient component as part of these Google-related changes as well as to support Bluetooth Classic on iOS. There is a design document with some proposed changes:
I think the second option is useful. A comprehensive tutorial on Android12+ bluetooth connection with block examples may be a useful addition as may an elaboration of the third method which does the connection at program start and allows for a bluetooth connected true/falseblock.
I had the same issue. The problem is your app does not have permission to see nearby devices. The solution is to give your app permission on your phone (no code changes in your app).
on your phone, goto settings
search for your app
in App Info for your app select Permissions
change Nearby Devices from Not Allowed to Allowed
Done
By the way, the very first time you run the app, Android will ask if you want to grant the app this permission. If you say no, or ignore the pop-up, the permission will be set as Denied. Android will not ask again.
The phone asks for permission to do so. I give it. Checking permissions, nearby devices are allowed and no permissions are denied. The code is good then, Thank you for that. I was tearing my hair out wondering what was wrong. Now I know that it is ok, I can walk away head high.
This is the simple and reliable way to connect an Android 13 phone using classic bluetooth to an Arduino or ESP32. Anything unnecessary to the basic function has been stripped out. Click the listpicker and it sends "hello" to the remote device. Much of this little was from Anke's connector widget for which help I am very grateful.
Following a deeply offensive message from Patryk, I have withdrawn the solution
Hi,
I am new in App Inventor and I am writing to ask your support.
I want to develop an app to send&receive data from the smartphone to HC5+Arduino by Bluetooth.
I have search information and copied the code but I still have problem.
The problem is when I try to open the list of BT devices, the screen is black and no list appears.