Book Image

Google App Inventor

By : Ralph Roberts
Book Image

Google App Inventor

By: Ralph Roberts

Overview of this book

<center><iframe src="http://www.youtube.com/embed/UgRhYG_bvW8" width="500" height="315" frameborder="0"></iframe></center> <p>The number of mobile apps has grown exponentially in the last two years. If you want to join the crowd, Google’s App Inventor is the easiest and best tool for you to get started with. It is a tool to create Android phone apps and uses a graphical user interface, and drag and drop methods to create apps. It’s so simple that anyone can build an app.<br /><br />Learn how Google App Inventor eliminates the mystery around programming. It is a visual language, where we simply drag and drop blocks (graphic elements representing blocks of code) in various combinations to give us applications that run on our phones or other Android-based devices. No programming background is required. Playing with blocks has never been more fun!<br /><br />The emphasis is on creating apps that work and that you understand fully. The first part of the book gives you a sound foundation in the basics, and lots of tips on how to use App Inventor. The second part is all about creating complete apps ready for real world use. The book includes apps that communicate, use databases to remember, surf the Web and other networks, use GPS and various sensors on your phone, and let you write or play games.</p>
Table of Contents (19 chapters)
Google App Inventor
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Preface

Google App Inventor is from the Internet giant Google, home of the famous search engine. Google also develops the Android operating system found on smartphones and tablet computers from many manufacturers including HTC, Motorola, Samsung, and a growing host of others.

In late breaking news as this book goes to press, Google and MIT (Massachusetts Institute of Technology) have announced that App Inventor will be supported by MIT's new Center for Mobile Learning. People from MIT (such as Hal Abelson and Mitchel Resnick) who first developed App Inventor will continue to be associated with its development. More about this change at the end of this book.

Some reviews of App Inventor call it limited. This is wrong. Google App Inventor is already powerful and ready to produce complex useful and marketable apps (as I and many others have already accomplished using it). Additionally, the software's still in beta (development and testing stage) — new features and capabilities continue to be added. But, don't just take my word for how useful App Inventor is; let me show you throughout this book.

Until App Inventor was introduced, programming apps (applications) was an esoteric art form involving cryptic lines of Java code understood only by a few programmers. You were required to write line upon line of cryptic code. Now, we can just pull blocks together in easy visual programming. Can anyone do it? Yes, we can!

What this book covers

Chapter 1, Obtaining and Installing Google App Inventor: here, we create a personal account on the Google App Inventor site, set up Java on our computer, and connect our phone or other Android device to our computer.

Chapter 2, Learning Components: here, we choose and use various components. Components may be thought of as services. For example, basic components include buttons, labels, checkboxes, and so forth. Media components allow us to play sounds, show videos, and so forth. Social components let us interact with others by phone calls, e-mail, texting, Twitter, and so on.

Chapter 3, Playing with Blocks: here, Blocks (of code, but we never have to see the code) let us tell the components what we want them to accomplish. It's all visual now, dragging-and-dropping blocks into various configurations. Blocks are simply the logic that instructs the component services how to act and in what order tasks happen. In this chapter, we look at each type of block and how it is used and create some useful apps.

Chapter 4, Mastering Concepts and Advanced Components: here, Concepts extend the power of our apps, giving us access to even more than can be accomplished with components and blocks. The Activity Starter lets one app call another. A TinyWebDB lets us set up a small database on the web so that apps can access data as needed rather than storing it all in the limited space on a smartphone or other Android device. The location sensor gives us access to GPS, letting us write apps such as those that would track our travel, tell us our speed and elevation, and more. In this chapter, we explore concepts and master their use, building several neat example apps.

Chapter 5, Apps That Communicate: here, Android devices right now are primarily phones. But, even tablet computers (pads) need to communicate with the world. This chapter covers apps that call, text, e-mail, and even Tweet.

Chapter 6, Apps That Remember: here, any Android device is really a small (yet powerful) computer. Computers excel in collecting and manipulating data. In this chapter, we devise apps that remember data for us, help us collect it, and present it to us by whatever criteria we specify. The apps we pull together in this chapter will remember stuff (accumulate and return data).

Chapter 7, Apps That Surf the Web: mostly, every Android device connects to the Internet. Our apps can also! This chapter shows us how to use networks and the Internet to exchange data and more. With the power of apps, you'll find an unlimited data plan pays for itself soon enough. Let's build some apps that are web-aware!

Chapter 8, Apps That Know Where They Are: here, we come to know that Android devices have a lot of built-in sensors and features that use them. Many of those we've already used, but what about location awareness? Your phone knows where it is, or can find out quickly. And, we can build apps using that power and much more relating to maps, navigation, and location!

Chapter 9, Games and Animation!: historically, creating video games has been a long and complex undertaking. All that has now changed! Google App Inventor has all we need to construct some very powerful and entertaining games with very little effort. In this chapter, we unleash our imaginations! Prepare to have fun—before and after dragging blocks into some neat games.

Appendix A, Links and Resources: mentions some useful websites and additional software, which all augment the power of App Inventor.

Appendix B, Last-Minute Update: Like any good open source software with a growing user base, changes occur. Google is releasing App Inventor to world-famous MIT (Massachusetts Institute of Technology), which created it in the first place. This is a strong move for AI—which can only improve it—and here are some details as I know them so far.

Appendix C, Final Last-Minute Update: here, are the last-minute updates on this process and that App Inventor is changing from Google back to MIT, where it was first created. This is a very positive change for the growth of AI.

What you need for this book

App Inventor basics—both in hardware and prior knowledge—are minimal. You need only a computer and an Internet connection. It helps to have a smartphone or other Android device, but not necessary as you can emulate (use software on your computer, which we will install in Chapter 1, Obtaining and Installing Google App Inventor to test apps).

As to prior knowledge and programming experience needed in creating apps and publishing them to places such as the Android market, you need practically none! This is the truly beautiful part of AI: its visual interface allows anyone from elementary school kids to us older people to make apps from the beginning without special knowledge.

Who this book is for

Again, because of the easy visual interface in which blocks are dragged together to create the operational logic of apps, just about all of us can quickly master and build working, useful apps.

In short, this book is for all of us, and especially for those who have never programmed before. AI makes it simple.

Conventions

In this book, you will find several headings appearing frequently.

To give clear instructions of how to complete a procedure or task, we use:

Time for action heading

  1. 1. Action 1

  2. 2. Action 2

  3. 3. Action 3

Instructions often need some extra explanation so that they make sense, so they are followed with:

What just happened?

This heading explains the working of tasks or instructions that you have just completed.

You will also find some other learning aids in the book, including:

Pop quiz heading

These are short multiple choice questions intended to help you test your own understanding.

Have a go hero heading

These set practical challenges and give you ideas for experimenting with what you have learned.

You will also find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "Open up a new project or the my_spiffy_new_app, the one we created earlier".

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Click on More information in the mini dialog box above for additional info".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to, and mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt Publishing, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.