Disclaimer: This book is an incomplete rough-draft text book on Google's App Inventor.

Chapter 1. Introduction
Chapter 2. Building and Deploying Apps with App Inventor
Chapter 3. An App Is...
Chapter 4. Components, Properties, Events, and Functions
Chapter 5. Animation
Chapter 6. Lists
Chapter 7. Conditional Blocks
Chapter 8. Iteration
Chapter 9. Web Services  

Chapter 1: Introduction

Programming is like magic to most people, and only a small percentage of humans ever try it. This is unfortunate, as there are many very creative people that don't even dream of applying their creativity, at least directly, to building software. Most people consider the apps they use on their computers and phones as beyond their control-- they are stuck with being consumers, and not producers, or even "customizers", of software.  The software we now use would certainly be better if the tools for building it were accessible to more people.

There has been progress. The web started out as read-only-- only web masters could create web pages and most of us just "consumed" the information out there. With blogs, wikis, social networks, and Twitter, the web has now become a read-write web, and most everybody is now "part of the conversation".

However, there is still a large chasm in terms of producers and consumers: though many now blog and create web pages, there are still few who know how to create apps-- software that displays information dynamically and can respond to user input and other events. Just as there is a digital divide, there is also a programmer divide that limits people's control over the devices they use.

Can this divide be breached? Can ordinary people be taught to program their computers and their phones? There are reasons to believe they can. Young people today are incredibly computer literate compared to the previous generations. They don't fear computing-- it is part of their lives from an early age.  And they use computing hours upon hours a day. Thus, they are extremely motivated to have useful software and to be able to customize it for their own personal use.

Google is very interested in this question, and to explore it they have designed a new visual programming language, App Inventor, designed to allow people to program their phones. Here is Google's vision:

Mobile applications are triggering a fundamental shift in the way people experience computing and use mobile phones. Ten years ago, people "went to the computer" to perform tasks and access the Internet, and they used a cell phone only to make calls. Today, smartphones let us carry computing with us, have become central to servicing our communication and information needs, and have made the web part of all that we do. Ten years ago, people's use of computing was largely dissociated from real life. With the ubiquity of social networking, online and offline life are becoming fused. (Our) exploration is motivated by the vision that open mobile platforms like Android can bring some of that same change to introductory Computer Science, to make it more about people and their interactions with others and with the world around them. It's a vision where young people—and everyone—can engage the world of mobile services and applications as creators, not just consumers. Through this work, we hope to do the following:

  • Make mobile application development accessible to anyone.
  • Enhance introductory learning experiences in computing through the vehicle of Android’s open platform.
  • Encourage a community of faculty and students to share material and ideas for teaching and exploring.

The App Inventor visual language makes developing Android apps
considerably easier than with a traditional programming language. With App Inventor, everything you can do is visible, and you program by piecing together blocks representing phone functionality and data. It is similar to the  Mindstorms blocks language for programming Lego robots, but you program your phone instead.

The blocks language makes things easier, and Google's target audience was people without programming experience, so ease-of-use was part of the design. But programming with App Inventor is still a difficult task and gets more complex as you build more complicated apps.

The key from a learning perspective is motivation: people are
significantly more motivated to learn programming and computer concepts
because they are building something fun that they can use in their every
day life. In teaching App Inventor, I've been amazed at how hard students have worked-- they're motivation level has been significantly higher even compared courses in which I've taught fun programming applications like robots or graphics. My belief is that they are more motivated because they are building "real" software-- software that can benefit their everyday lives.

This book steps you through the process of building Android apps using App Inventor. We'll begin with some simple apps-- an app that speaks what you type, and an app that moves a ball around the screen. But rather quickly we'll progress to more complicated apps and you'll be building games, educational software, Twitter clients, and maybe even the next killer app for the Android platform!

Getting Started: Downloading Some Apps

The Market
The Android Market has thousands of apps, many of which are free to download. You can search for specific keywords to find an app, and you can read a blurb about the app and see reviews of it before downloading. Before embarking on our journey to learn programming, definitely download some apps and become acquainted with how Android apps look and behave.

Barcode Scanner
There are two specific apps that we'll use in the programming lessons. The first is a barcode scanner. This is required because when you build an app, App Inventor creates a barcode for the app. With an Android barcode scaner, you can scan the barcode in order to install the new app on your phone. Very cool!

One popular barcode scanner is from ZXing. If you go to the Market and search for it, you'll find it. Just step through the installation instructions and you'll have a barcode scanner. For fun, try scanning the ISBN barcodes of some books to see what the scanner does with them.
Text To Speech

The first sample app we'll create will speak the words the user types. For this, you need to have Text to Speech (TTS) library code on your phone. With TTS, your apps can speak words that have been typed in or sent as a text to your phone. You can download a TTS app named TTS Service Extended at the Android Market.

Once you've downloaded it, open the app and click on menu to choose a Default Engine. If you don't choose an engine, the app won't work (there's no default setting unfortunately). You can also change the default language and speech rate.

Once you've installed it, test it by clicking on the App to start it, then clicking menu and choosing "Listen to a preview". Then try changing to a different language to see what happens.