Hello everyone, so I have this issue and i am not sure if its a bug or if i am doing something wrong.. (i am probably doing something wrong)
So basically, I am really new to MIT App Inventor and everything and I have been experimenting with MIT App Inventor to make my Project.
My Project for now consists of a linear motor that has to either go up, down or stand still. I want to control the movement by a self made App, bluetooth and an ESP32.
Basically, what i would like my app to do is: 1) Pick a bluetooth device (the ESP) and show all bluetooth devices in my surroundings in the list. And then, with the buttons, i would like to control the movement (either up or down)
The issue is, whenever i try to connect a bluetooth device by app (by clicking on the list), my screen just turns black! And I cant even get out of this. The only way to then try again to connect my Tablet to something is by closing the App completely and the restarting it..
(Canned Response ABG - Bluetooth non-BLE SCAN Permission Blocks)
The easiest solution, for immediate relief
(from @Barry_Meaker) ...
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,
search for your app
in App Info for your app select Permissions
change Nearby Devices from Not Allowed to Allowed
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.
A more complex approach, for professional app development:
Yes this is it and it worked for me. The only thing that i can think of rn is that you have to connect the ESP beforehand with bluetooth and then you can choose it on the app -> shortly, the bluetooth device you want to be connected with has to be coupled with you phone or whereever you downloaded app is on.
i am also really new to this so this is the only thing i can think of, i hope it helps
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.