learn and build innovative projects

Bluetooth Control App using MIT App Inventor

No comments :
To design a Bluetooth Control App using MIT App Inventor,  follow the steps below:

MIT App Inventor website:

Click on this link ai2.appinventor.mit.edu.

Log in to MIT App Inventor:

Log in with your Gmail account to initiate the development of your Android application. Navigate to the "Projects" menu or menu bar and choose "Start new project." Provide a name for your project and click the "OK" button to proceed.

Sign In with your gmail account and start develop your android application. click on the Projects menu and select the Start new project and name your project and press OK.

Upon completing the previous steps, you will enter the application development section. In this area, you can design the layout of your app using the "Designer" and implement its functionality using "Blocks."

Designer Panel:

Select "Layout" from the Palette and select "Horizontal Arrangement." Drag and drop this onto your blank screen. This component will serve as the container for all the interface elements in your app. 

Select Layout > Horizontal Arrangement in the Palette and drag this on to your blank screen. This will hold all of the interface elements.

Navigate to the Properties section in the right corner of the page. Adjust the Height property to 100 pixels and set the Width property to Fill Parent.

Go to Properties in the Right corner of page and Change the Height property to 100 pixels… and the Width property to Fill Parent… . Change the properties as shown in below image:

Select the ListPicker component from user interface. ListPicker is the button, which displays the list of available bluetooth devices and handle the selection.

Select the ListPicker component from user interface. ListPicker is the button, which displays the list of available bluetooth devices and handle the selection.

Select properties > Text and change the text display. You can also change the height, width, color using the properties panel.

Select properties > Text and change the text display. You can also change the height, width, color using the properties panel.


Select properties > Image and upload the image to display.



Choose image file from your computer.

MIT App inventor 2


Select Layout > from palette and select Horizontal arrangement. Horizontal arrangement component is to display a group of components laid out from left to right. We are using this component to display two buttons horizontally which is “ON” and “OFF”. We need 4 Horizontal Arrangement with same properties.

Select Layout > from palette and select Horizontal arrangement. Horizontal arrangement component is to display a group of components laid out from left to right. We are using this component to display two buttons horizontally which is “ON” and “OFF”. We need 4 Horizontal Arrangement with same properties.

After this, click and hold on the word “Button” in the palette, drag your mouse over to the Viewer and drop the button over the horizontal view and do same by dragging another button. These two buttons will look left to right. Rename the buttons from “Button1 to LED1ON” and “Button2 to LED1OFF”. Also change the text and background colour of buttons from properties, which will display on users screen.


After this, click and hold on the word “Button” in the palette, drag your mouse over to the Viewer and drop the button over the horizontal view and do same by dragging another button. These two buttons will look left to right. Rename the buttons from “Button1 to LED1ON” and “Button2 to LED1OFF”. Also change the text and background colour of buttons from properties, which will display on users screen.

Add a label text , as a status about Bluetooth connection(remove text in properties Text option).

MIT App inventor 2

At last, connectivity from palette select Bluetooth Client and drag and drop to the viewer panel. Note that, this is the Non-visible component.


You can change color, text, width, height , background of the components


Final app will look like the above image. You can change color, text, width, height , background of the components.

MIT App Inventor Block Editor:

The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.

Click on the list picker and select ListPicker Before Picking.

The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.

Click on listpicker and attach Set elements block as shown in below.

The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.

Click on Bluetooth Client and attach AddressesAndNames to Elements.

The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.


The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.

Again click on list picker and select ListPicker After Picking and attach the if Built-in condition from control block.


The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.


Click on Bluetooth Client and attach .connect, Addresses to if condition like as shown in below. 

The Blocks Editor is where you program the behaviour of your app. There are Built-in blocks that handle things like math, logic, and text with each components you have added.

Click on Listpicker and drag selection block and attach it to Bluetooth client.

MIT App Inventor 2

Click on Label and drag Text block and attach it to “then” condition.

MIT App Inventor 2

Click on Built-in Text and drag empty block and attach it to Text label.


MIT App Inventor 2


MIT App Inventor 2 Block Editor

By clicking on the image on App Screen, It will show you paired Bluetooth   connections and click on your Bluetooth devise name. It will established communication between selected device and display the text on App screen Bluetooth Connected.


Click on Button and drag the when Button1 .click block.



Click on Built-in Control block and drag if condition and attach to Button1 as shown in below.




Click on BluetoothClient1 and drag isConnected block and attach it to If condition.

MIT App Inventor 2 Block Editor



Again Click on BluetoothClient1 and drag .sendText, Text block and attach it to “then” condition.

MIT App Inventor 2 Block Editor

Click on Built-in Text and attach empty text box to BluetoothClient as shown in below.

MIT App Inventor 2 Block Editor


MIT App Inventor 2 Block editor

Follow these steps to remaining Buttons and change text in Text boxes as you required.

Final app blocks will look like the below image.

MIT App Inventor 2 Block Editor

Once your app is finished download apk and install it in Android Mobile.




For Arduino Bluetooth Project Click on below link:

Control LED Using HC-05 Bluetooth, Arduino And Mobile App





No comments :

Post a Comment

Internet of Things

What is Internet of Things?

What is IoT? The Internet of Things (IoT) is the network of physical objects/things are embedded with software, sensors, and hardw...