Is it possible to specify an address and seek permission to connect? I don't need a list and I know I am on Android 13. How could that be contrived?
What about providing an updated screenshot of your relevant blocks? Please do NOT post all blocks... thank you...
Taifun
Yes, if you attempt to call Connect with an address it will ask for permission first if permission has not been granted. However, because most code is written assuming that Connect succeeds, you will have to adjust your code to account for the fact that Android may need to prompt the user for permission first. The Connect block will return false in this case.
I'd love to but cannot find a way to do so without posting all the blocks. Still as the component doesn't work very well without complicated workarounds, I think I'll just give App inventor a miss from here on in, thanks. It is far from the simple app writer it was intended to be and has caused me nothing but frustration just trying to do this last basic thing and finding that it simply does not work for anybody except for the dedicated expert - sometimes.
If the permissions have been given once, they do not need to be given again - so on launch, the App should check TinyDb to see if a previous session has already obtained the permissions - if true for both, no need to bother the User again.
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.
Taifun
Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.
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.
Currently nothing works. I have no confidence that it ever will so I'm out of here.
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.
I have allowed all permission to the APP.
My smartphone is a Samsung Galaxy A13 with Android version 13.
Please, could you help me to understand why it does not work?
Thanks in advance
Fulvio
No.