UNIT 5: APP INVENTOR 2 (LEARN TO MAKE YOUR OWN APP'S)
Broadcast Hub - App Inventor 2 - Advanced Tutorial
FrontlineSMS is a software tool used in developing countries to monitor elections, broadcast weather changes, and connect people who don’t have access to the Web but do have phones and mobile connectivity. It is the brainchild of Ken Banks, a pioneer in using mobile technology to help people in need. The software serves as a hub for SMS text communication within a group. People send in a special code to join the group, after which they receive broadcast messages from the hub. For places with no Internet access, the broadcast hub can serve as a vital connection to the outside world. In this chapter, you’ll create a broadcast hub app that works similarly to FrontlineSMS but runs on an Android phone. Having the hub itself on a mobile device means that the administrator can be on the move, something that is especially important in controversial situations, such as election monitoring and healthcare negotiations.
In this tutorial, you’ll build a broadcast hub app for the fictitious FlashMob Dance Team (FMDT), a group that uses the hub to organize flash mob dances anywhere, anytime. People will register with the group by texting “joinFMDT” to the hub, and anyone who is registered can broadcast messages to everyone else in the group.
Your app will process received text messages in the following manner:
1. If the text message is sent from someone not yet in the broadcast list, the app
responds with a text that invites the person to join the broadcast list.
2. If the text message with the special code “joinFMDT” is received, the app adds the
sender to the broadcast list.
3. If the text message is sent from a number already in the broadcast list, the message
is broadcast to all numbers in the list.
This app is more complicated than the No Text While Driving app, but you’ll build it one piece of functionality at a time, starting with the first auto-response message that invites people to join. By the time you complete this, you’ll have a pretty good idea of how to write apps utilizing SMS text as the user interface. Do you want
to write a vote-by-text app such as those used on television talent shows, or the next great group texting app? You’ll learn how here!
What You’ll Learn
The tutorial covers the following App Inventor concepts, some of which you’re likely
familiar with by now:
• The Texting component for sending texts and processing received texts.
• List variables and dynamic data—in this case, to keep track of the list of phone numbers.
• The for each block to allow an app to repeat operations on a list of data. In this case, you’ll use for each to broadcast messages to the list of phone numbers.
• The TinyDB component to store data persistently. This means that if you close the app and then relaunch it, the list of phone numbers will still be there.