Is there a guide available for connecting to a specific HC-05 Bluetooth classic device?
I have made an App that successfully connects using list picking, but now I just want to auto-connect to the same device every time, as soon as App starts.
As related question: if I start a new project, and drag in BluetoothClient, then in Block editor BluetoothClient1 only offers one "When .. Do" block as shown:
Just store the mac address of that Bluetooth device, i.e. the listpicker selection in TinyDB and read that address next time after starting the app to connect directly
You only can use events which exist... you can't invent arbitrary events...
I was planning to simply hard code the bluetooth address into the code, may not need tinyDB.
But I'm really asking what blocks to use to set up Bluetooth classic link to just one device, and how to find them in the tool.
"You only can use events which exist" Can you expand on this please. For example the only way I've got a block like "when BluetoothList.BeforePicking" into my project is by uploading some else's aia found in the forum. I'm asking how to find blocks like this myself within the tool, they seems to be well hidden !
You can find the listpicker in the user interface drawer User Interface
A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook http://www.appinventor.org/book2 ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .
Please don't give me general answers, I'm asking a speciifc question:
What are the steps to get those (bluetooth) blocks to appear in my blocks editor?
I promise you that for the last few weeks I've been looking at tutorials , reading the documentation (including the free book), searching the forum for answers. I've made good progres but this one quesion has stopped me in my tracks:
What are the steps to get those blocks to appear in my blocks editor?
Drag a listpicker into the working area to get a Listpicker1 component
Then rename it to whatever you want, for example to BluetoothList to get the blocks you are looking for
If I have correctly understood your question, i.e. that you already know the address of your HC05 shield, by elaborating what @Taifun has already suggested, instead of storing that value in the TinyDB, you can assign that value to a text variable, like the image below. In this way you really "hardcode" the address in your app.
Having assigned that, to connect always the same address, you can use the following blocks:
In my example, only after a successful connection, I enable a 10 ms clock (Ck_BT_Rx) that manages the BT communications.
The MiT App Inventor (MAI) is a really good tool and very comprehensive so there's a lot to uncover. Fortunately I'm comfortable with progamming (C++ mainly), so I found the basics very easy to pick up. Downloading & reading the docs, doing tutorials and asking on the forum over recent weeks has been helpful.
But there are some things that just aren't covered. For example if you search the web, docs or forum on bluetooth classic in MAI pretty much every example uses a listpicker = not what I needed. Hence this thread.
Every time I use MAI I find another trick or subtlety (that's a good thing!). For example through this thread discussion I realised why many of the blocks are not listed in the "Built-In" section of the blocks editor and are instead available by clicking on each component (in the left pane of the blocks editor).