Control a Relay with ESP32 via Bluetooth Using MIT App Inventor _Part 5

Control Relay with ESP32 via Bluetooth – Part 5 MIT App Inventor Customization

Welcome to the final installment of our series on controlling an ESP32 Relay via Bluetooth. In Part 5, we move beyond basic functionality and focus on App Deployment and UI Customization using MIT App Inventor.

A functional app is good, but a usable app is better. In this guide, I will walk you through the specific properties you need to change to brand your app, how to generate the installable APK file, and how to backup your source code using the .aia format.


Step 1: UI Customization in Designer View

To make your app look professional, you need to modify the Screen1 component properties. Here are the specific settings I use for a clean IoT dashboard:

  • AlignHorizontal: Set to Center (3). This ensures your ON/OFF buttons stay in the middle regardless of phone size.
  • Icon: Upload a 512x512px PNG file here. This replaces the default MIT robot logo on your phone's home screen.
  • Title: Change this from "Screen1" to your project name, e.g., "Smart Relay Controller".
  • BackgroundColor: Avoid pure white. I recommend a dark grey (#333333) for better visibility of status LEDs.

Step 2: Understanding File Formats (.AIA vs .APK)

When working with MIT App Inventor, it is crucial to understand the difference between the two export options, as they serve different stages of the development lifecycle:

File Type Purpose Action
.AIA Project Source Code. Use this to backup your blocks or share the editable project with other developers. Projects > Export selected project (.aia)
.APK Installable Package. This is the compiled app that runs on Android. It cannot be edited. Build > Android App (.apk)

Step 3: Compiling and Installing

To move the app from the browser to your phone:

  1. Go to the top menu and select Build.
  2. Choose Android App (.apk). The server will take about 60 seconds to compile your blocks.
  3. A QR code will appear. Scan this with your phone to download the file directly.
  4. Note: You may need to enable "Install from Unknown Sources" in your Android settings since this app is not coming from the Play Store.

Troubleshooting Common Errors

If your APK fails to build or install, check these common issues I have encountered:

  • Error 1101 (Unable to get a response): This usually happens if your uploaded image assets (icons/backgrounds) are too large. Keep images under 1MB.
  • Parse Error on Install: This occurs if you export an .aia file and try to install it as an app. Ensure you are exporting the .apk from the Build menu.
  • Bluetooth Permission Denied: For Android 12+, ensure your MIT project properties have BluetoothClient permissions explicitly enabled in the settings.

Downloads & Resources

You don't have to start from scratch. You can download my completed project file (.aia) and import it directly into your MIT App Inventor account to inspect the blocks.


Watch the Full Walkthrough

For a visual guide on navigating the MIT App Inventor interface, watch the full tutorial below:


Missed a step? Check out Part 1 (Wiring) or Part 3 (App Design).

Comments

Popular posts from this blog

How to Import CSV Files into PostgreSQL Automatically

Apache NiFi ETL Tutorial for Beginners | Installation & Data Pipeline Basics

ESP32 TFT LCD 240x240 Tutorial-Display Images & DHT11 Sensor

Contact Form

Name

Email *

Message *