Coding Club

Mobile apps with App Inventor

Six apps for phones and tablets, built in MIT App Inventor, a free tool that runs in your browser. You design each screen by dragging buttons and labels onto a phone, make it work by snapping blocks together, and test it on a real phone with the free Companion app.

Six days, six projects

One small project a session. Each one is a numbered list of steps with a picture of what to click and what you should see, then tests and stretch challenges for anyone who finishes early.

Type, tap Say it, and the phone reads it out.
Day 1Talk BackMake your first app: type anything, tap a button, and the phone reads it out loud.
A six!
Day 2Dice RollerBuild a dice app: tap Roll for a random number, and the app cheers when you roll a six.
A doodle in three colours.
Day 3Doodle PadMake a drawing app: drag a finger to draw, tap for dots, pick a colour, and wipe it clean.
Question 3, with two right so far.
Day 4True or False QuizBuild a quiz app that asks questions from a list, checks each answer, keeps score and knows when it is over.
Shake, and the phone gives its answer.
Day 5Shake ItMake a fortune telling app: ask a question, shake the phone, and it shows, speaks and buzzes its answer.
Tap the ball to catch it, before time runs out.
Day 6Catch the BallMake a phone game: a ball bounces round the screen, getting faster with every catch, and you have 30 seconds.

Get set up before day 1

You will need

  • A computer with a web browser
  • A Google account, or an App Inventor revisit code
  • An Android phone or tablet, or an iPhone or iPad, with the free MIT AI2 Companion app
  • The phone and the computer on the same WiFi
  1. Setup step 1: Open App Inventor

    Go to ai2.appinventor.mit.edu and sign in with a Google account, such as your school one.

    No Google account? Go to code.appinventor.mit.edu and choose Continue Without An Account. App Inventor gives you a revisit code: write it down somewhere safe, because it is the only way back to your projects.

  2. Setup step 2: Start a new project

    Click Projects, then Start new project. Type a name with no spaces, such as TalkBack, and click OK.

    Projects, then Start new project.
    Type a name with no spaces (1), then OK (2).
  3. Setup step 3: The Designer

    A new project opens in the Designer, where you design how the app looks.

    1. The Palette holds the components: buttons, labels, pictures, sensors and more.
    2. The Viewer shows the phone's screen. Drag components from the Palette onto it.
    3. Components lists everything in your app. Click one to choose it.
    4. Properties are the settings of the chosen component, such as its text, size and colour.
    The Designer's four parts: Palette, Viewer, Components and Properties.
  4. Setup step 4: The Blocks editor

    Click Blocks at the top right to switch to the Blocks editor, where you make the app work. The drawers on the left hold the blocks: drawers for maths, text, lists and more at the top, and a drawer for each component in your app. Click a drawer, then drag a block into the space on the right. Designer takes you back.

    Click Blocks to switch to the Blocks editor.
  5. Setup step 5: Get the Companion app

    To try your app on a phone or tablet, install the free MIT AI2 Companion app from the Google Play Store (Android) or the App Store (iPhone and iPad).

    The MIT AI2 Companion app, ready to connect.
  6. Setup step 6: Connect your phone

    In App Inventor, click Connect, then AI Companion. A box appears with a QR code and a six letter code. Open the Companion app on your phone and tap scan QR code, or type the six letters and tap connect with code. Your app appears on the phone, and from now on it changes the moment you change it on the computer.

    Connect, then AI Companion.
    Scan this code with the Companion, or type the six letters.
    Type the code and tap connect with code, or scan the QR code.
    Watch out The phone and the computer must be on the same WiFi network. If the school's network blocks it, ask your teacher about the emulator or a USB cable, under the same Connect menu.
  7. Setup step 7: Your work saves itself

    App Inventor saves your project as you work. To keep a copy of your own, click Projects, then Export selected project (.aia) to my computer. On Android, Build makes an app you can install and keep on the phone.

    Export selected project keeps a copy on your computer.
Notes for the teacher

Before the first session

  1. Open ai2.appinventor.mit.edu on a club computer to check the school's filter allows it.
  2. Decide on accounts. Students can sign in with a Google account, such as a school Google Workspace account. Students without one can use Continue Without An Account at code.appinventor.mit.edu, which gives each of them a revisit code. Keep a copy of every code: a lost code means lost projects.
  3. Phones or tablets need the free MIT AI2 Companion app, and must be on the same WiFi as the computers. School networks sometimes block the connection: test one device first. If they do, the emulator (Connect, then Emulator) works on Windows after installing aiStarter.
  4. One phone between two or three students is enough, since apps are tested in short bursts.

How the six projects build up

Day 1 introduces the Designer, events and the Companion. Day 2 adds random numbers and if then else, day 3 event parameters and drawing, day 4 lists, global variables and procedures, day 5 sensors and refactoring, and day 6 animation and a timer in a game.