How can i show available Bluetooth devices on label instead of listpicker

How can i show available Bluetooth devices on label instead of listpicker.

Set Label1.Text to BluetoothClient1.AddressesAndNames

Taifun

1 Like

Thank you for helping me. I used this method, but when I click on connect button the label does not show anything. I am working on an app in which label is work as output screen and textbox as input. User can connect the bluetooth module and other things with only using textbox like terminal in linux.


Hello Jaswant

Most times, there will be more than one device found - what are you going to do then? You cannot 'pick' anything from a Label. The choices are List Picker, List View, Spinner.

What you can do is set the Label with the device name:address selected from the List, storing that selection as a variable to use for the connection.

1 Like

Can I make a list of the available devices and then connect the device using giving index number of the list through textbox.

In a way, yes, but it does not make sense to do so, since the User has to select from the List in the first place.

1 Like

Why it shows nothing on the label. Can I only show it on the Label?

You can, but Labels are 'view only' components, and to show 'it' on a Label the User will need to select the device from a List in the first instance.

1 Like

Please help me to only show the available Bluetooth devices on label.
Please upload the blocks.

If your BluetoothClient1.AddressesAndNames does in fact return a List, you can do something similar to this example

postListToLable

Replace the example's scannedList with your List of Bluetooth devices.

Rather than copy code to build your Projects you might want to learn to code.
Here are some resources to help you learn to use the AI2 tools. 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 http://www.appinventor.org/content/CourseInABox/Intro and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles

How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling .

Also look here App inventor español. Offline. Tutorial. Ejemplos. Instalación. Códigos. Juegos. Curso gratis de App inventor. and here Tutorial Index | imagnity for more tutorials

Learn about components Component Reference
and visit the Library The MIT App Inventor Library: Documentation & Support Help>Library on the MENU

2 Likes

As pointed out by SteveJG, you need to learn more about App Inventor Jaswant.

Here is a Project file that does what you have requested:
BluetoothDevicesToLabel.aia (2.9 KB)

How to load a file (.aia) into MIT App Inventor:
ImportProjectFromComputer

1 Like

Thank you guys for this help​:relaxed::relaxed::relaxed:.
It's working. I will learn more about App Inventor. Thank you for providing me with the source from which to learn.

Thank you for giving your precious time.
I really appreciate it.:heart::smiley::smiley::heart:

Guys, it's working. Now I can connect the HC05 Bluetooth Module by only using the textbox and the label. I modified the code a little. I used the Focus Tool Extension to scroll the label to see the complete list.


Modified Project File :
BluetoothDevicesToLabel (1).aia (3.6 KB)

Once again, thank you all.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.