Preface - Hello App Inventor!: Android programming for kids and the rest of us (2015)

Hello App Inventor!: Android programming for kids and the rest of us (2015)

Preface

We think writing computer programs is fun and that those who can do it can make a difference to the world around them—sometimes in an almost magical way. But when you start out, it’s often hard to see how the programs you write can make any difference to anyone—for example, you might just be drawing simple shapes or adding up a bunch of numbers.

Back in 2012, we started using App Inventor with teachers and children and discovered it was a brilliant way to make computer programs that worked in the real world. Beginners could perform useful, imaginative, and fun tasks like a GPS treasure hunt or a homework excuse generator. The App Inventor books that helped us learn were great, but we wanted to focus on helping school-age kids and beginners become app creators. Paula proposed that we write a book, and within a day we had the original contents page and app list. This initial speed lulled Paula into a false sense of security, and colleagues now remind her that she waved her arms around and said “It’ll only take us 12 weeks!” She was only off by a factor of 8 ...

But what a couple of years it has been! Throughout the book, we’ve woven in key facts and resources useful to beginning programmers and always tried to develop original (or inspired!) working examples. We feel that the power of visual programming languages is brought out through the concepts and the huge variety of apps that can be produced by users of the book. Our companion website provides great graphics and sounds for each of the apps and a really useful table layout so users can set up their designs quickly and get down to learning to program with App Inventor right away.

We’ve used the resources from this book to teach App Inventor to primary-age kids, secondary-age kids, trainee teachers, experienced programmers, and experienced teachers—and what we always see is fun, satisfaction, and engagement.

We hope you get a lot out of the book and make fun apps for you and your friends. Who knows? You might even make the next award-winning killer app!

About this book

This book will help you become an App Inventor—someone who doesn’t just use a phone or tablet, but takes control of it! You’ll learn to create some fun apps, and along the way you’ll also learn programming skills that you can use in lots of other programming languages. We wrote this book for kids, but anyone who’s curious about programming and mobile devices will find it useful.

We aren’t expecting you to have any programming knowledge at all—we’ll start from the very beginning (you’ll be surprised how quickly you learn). You need to know your way around a keyboard and mouse, how to save files, and how to use a web browser like Chrome, Firefox, or Safari. You’ll also find it useful to know how to use an Android smartphone and access its menu settings. If you can do that, you can jump right in and get started making apps.

What is an App Inventor?

Before we answer that question, we need to answer this one: “What is an app?”

An app is a computer program—a list of instructions that tells a computer what to do. Normally, the word app is used to talk about programs written for smartphones and other mobile devices like tablets. It’s going to get a bit longwinded to keep talking about “smartphones and other mobile devices like tablets,” so throughout this book we’ll use the term phone or smartphone to mean any mobile Android device such as a smartphone or tablet.

An App Inventor is two things:

· App Inventor is a programming language you can use via an internet browser to design and make apps for Android phones. It’s a graphical environment—that means you don’t have to type complicated code. Instead, you drag and drop objects on screen and plug blocks of code together like a jigsaw puzzle. If you’ve used the Scratch programming language, this will be familiar.

· You are an App Inventor. Once you’ve done the first exercise in chapter 1, you can proudly claim, “I am an App Inventor!” That’s someone who can create code that runs on a phone.

What is Android?

We’ve mentioned Android a couple of times already. Android is an operating system (OS) that runs on lots of mobile devices. An OS manages a computer’s hardware—that’s all the bits you can touch, including computer chips and circuit boards and cameras and touch screens.

Windows, Mac OS, and Linux are OSs that are mainly used in desktop and laptop machines. Android, iOS, and Windows Phone are the main OSs you find in mobile devices. So App Inventor lets you program pretty much any Android device, but it won’t work on iPhones or Windows phones.

Why should you be an App Inventor?

Learning to program computers is fun! It can sometimes be frustrating when things aren’t working, but the joy you get from solving these problems is huge.

Programming is a great skill to learn because it helps you think in a certain way—this is sometimes called computational thinking. What this really means is that once you can program, you can solve lots of problems in the real world, too. Even if you become an architect, an artist, an engineer, or a scientist, the skills you learn from programming are useful. These skills are things like

· Thinking creatively

· Problem solving

· Sequencing steps

· Logic and math skills

· Understanding people’s needs

· Patience and tenacity (sticking with it)

· At the moment, the world needs computational thinkers and good programmers, and becoming an App Inventor is a great place to start a career as a coder, game designer, or entrepreneur.

Why choose the App Inventor language?

There are loads of choices of programming languages—LOGO, Python, Small Basic, Java-Script, Logo, Scratch, and Kodu. We think you should try them all! What’s different about App Inventor is that it gives you access to some powerful hardware that you can carry in your pocket—a smartphone. That means you can create apps that

· Can do very cool things like use your GPS location, make phone calls, send texts, read barcodes, and take pictures or videos.

· Are useful in the real world. You might make an app that

o Reminds you to do important things, like take medication

o Sends an alert text with your phone’s location

o Uses pictures to tell small children what time of day it is

· Being able to create apps that your friends and family can use on their phones is an amazing motivator to learn to program and to make your apps the best they can possibly be. If you get really good, you can even sell your apps—for example, on the Google Play store.

· The other reason we’re excited about App Inventor is that because it’s a drag-and-drop graphical language, beginners tend to make fewer mistakes, and it’s easier to spot them when you do (this is true of languages like Scratch and Kodu, too). It can be frustrating to hunt down missing periods or capital letters in typed programming languages—and that’s one thing you don’t need to worry about when you’re starting out in App Inventor.

What you need

We’ve included setup instructions in chapter 1, and there’s more on the App Inventor website. To get started, you’ll need

· A computer running Windows, Mac OS X, or Linux (we used Windows).

· A web browser. Firefox, Chrome, or Safari is fine (Internet Explorer doesn’t work at the moment, but there are plans for an update soon).

· An Android phone isn’t essential, but it makes things a lot more fun! A wireless internet connection or USB lead from your phone to your computer is required too.

· A Google account (more about this in chapter 1).

· Website resources. All the files we use (like graphics and sound clips) can be found at www.manning.com/HelloAppInventor.

· Good ideas and a little patience!

Ways of using this book

We’ve written this book in sequence so you get the essential ideas of computing and programming in an order that we think makes sense. The early examples in the book include step-by-step instructions (walkthroughs). Later, we assume you already know lots of things; and as you progress, the activities become more challenging as your skill level increases. The apps tend to get more complicated as you go through the book, too, and those in chapter 14 bring all the ideas you’ve learned together in two quite big and complicated apps.

If you’re a beginner, we suggest that you work through the book in order; it probably makes the most sense that way. If you know a little about programming, you might find it useful to skip around and try different sections that interest you.

We’ve included “Try It Out” and “Taking It Further” sections that give you additional challenges. This is how you find out just how much you know! It’s easy to follow a set of instructions, but can you apply those skills to something else? We strongly suggest that you try these exercises and suggestions. You’ll also find some quiz questions at the end of each chapter to check that you understand the computing concepts covered.

Symbols you’ll see

We’ve used these symbols to highlight important information throughout the book:

Learning points give you general computer science concepts that you can research further. They explain the “Why is this important?” questions and give you keywords that you’ll see in this book and others. They’re also useful for teachers in planning lessons.

The Let’s invent! symbol indicates the beginning of a practical activity. You’ll see this whenever we start a new app.

Some apps only work properly on a real phone—you can make a phone vibrate, but that won’t work if you use the onscreen emulator (more about this in chapter 1). The Phones only! symbol means this part of an activity can only be tested on a phone rather than in the emulator.

Code conventions and downloads

All source code in listings or in text is presented in a fixed-width font like this to separate it from ordinary text. Code annotations accompany many lines of code, highlighting important concepts.

The code used in this book, along with graphics and sound clips, is available from the publisher’s website at www.manning.com/HelloAppInventor.