App decommunication : Hub Broadcast

Durée estimée: 90 minutes

Text Version


(Teacher Tube version)
BroadcastHub This tutorial uses the App Inventor Texting Component to receive and send text messages to a list of registered members. The device running the app is the hub. Other devices can text "joinhub" to the hub to become a member. Messages sent to the hub by registered members are distributed to all the members. This version is a variation of the MIT tutorial It assumes that you know how to set up your device for using the Texting component over Wifi (i.e., for devices with no Sim card or mobile service plan).  The lesson includes several programming exercises that add enhancements to the basic app.

Objectives: In this lesson you will learn to :

  • create an app that
    • uses the Texting component and Google Voice to create a hub for group SMS messages,
    • follows a complex if-else algorithm for processing incoming texts;
  • gain additional experience using procedures to organize an app.

Building the BroadcastHub app

To get started open App Inventor with the BroadcastHub Template in a separate tab and follow along with these tutorials. 

You can either click on the thumbnails to view the video or click here to read the tutorial.

Enhancements: Creative Projects

Here are some ideas for programming projects.

  • Abstraction: Break the if-else code into more easily readable chunks by defining and using procedures with parameters.
  • (If/Else Algorithm:) Modify the distributeTheMessage procedure so that it doesn’t distribute the message back to the sender of the message. HINT: You’ll need an if-else block for this.
  • Add a Clock component to the app so that you can display a timestamp when a message is received. The Clock component contains methods that enable you to get the current time (Clock.Now) and format it into a date and time.
  • Add a TextToSpeech component so that the new members can be ‘announced’ to the user when a ‘joinhub’ message is received.
  • Persistence: Add a TinyDb so that the members of the hub can persist from one use of the app to another.
  • Advanced: Modify the app so that it saves the members’ names, as well as, phone numbers of the members of the hub. HINT: Use a list of lists that includes the member’s name and phone number or use a delimited string such as: “5558885555:Joe” where the : separates the name from the phone number. For this latter approach you should design functions to get the name or the phone number parts from the string.
  • Advanced: Modify the app so that a member can be removed from the hub. HINT: You will need to design a protocol for leaving the hub (e.g. ‘removemember’)
  • Longer-term (Advanced) Project: Come up with your own variations of this app. For example, one variation might be to extend the app to have multiple hubs -- family, friends, etc. And, allow members to tag their messages with certain prefixes to indicate which distribution list should receive the message -- e.g. “family: The picnic is at 1 PM’


Not yet started
1 point
A broadcast hub is __________________.
Not yet started
1 point
What type of control structure is a For Each loop?
Not yet started
1 point
If there are five members in the broadcast hub, what would the following block of code do?

Not yet started
1 point
E-mail, SMS, and social media, such as Facebook and Twitter, have impacted our society by _______________.
Choose all that apply.

Reflection: For Your Portfolio

Create a new page named Broadcast Hub under the Reflections category of your portfolio and write brief answers to the following questions:
  1. How is the For Each loop used in this app? What is the significance of this loop?
  2. Besides Texting and the For Each loop, what programming concept plays a significant role in the functionality of this app? Explain.