App Inventor for Android
Total Page:16
File Type:pdf, Size:1020Kb
01_9781119991335-ffirs.indd v 3/28/11 12:44 PM App Inventor for Android: Build Your Own Apps — No Experience Required! 01_9781119991335-ffirs.indd i 3/28/11 12:44 PM 01_9781119991335-ffirs.indd ii 3/28/11 12:44 PM App Inventor for Android: Build Your Own Apps — No Experience Required! Jason Tyler A John Wiley and Sons, Ltd, Publication 01_9781119991335-ffirs.indd iii 3/28/11 12:44 PM App Inventor for Android: Build Your Own Apps — No Experience Required! Th is edition fi rst published 2011 © 2011 John Wiley & Sons, Ltd Registered offi ce John Wiley & Sons Ltd, Th e Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom For details of our global editorial offi ces, for customer services and for information about how to apply for permission to reuse the copyright material in this book, please see our Web site at www.wiley.com. Th e right of the author to be identifi ed as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher. GOOGLE is a trademark of Google Inc. Th e Android Robot is created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License located at http://creativecommons.org/licenses/by/3.0/. Screenshots and images from App Inventor for Android are created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License located at http://creativecommons.org/licenses/by/3.0/. Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. DESIGNATIONS USED BY COMPANIES TO DISTINGUISH THEIR PRODUCTS ARE OFTEN CLAIMED AS TRADE MARKS. ALL BRAND NAMES AND PRODUCT NAMES USED IN THIS BOOK ARE TRADE NAMES, SERVICE MARKS, TRADEMARKS OR REGISTERED TRADEMARKS OF THEIR RESPECTIVE OWNERS. THE PUBLISHER IS NOT ASSOCI ATED WITH ANY PRODUCT OR VENDOR MENTIONED IN THIS BOOK. THIS PUBLICATION IS DESIGNED TO PRO VIDE ACCURATE AND AUTHORITATIVE INFORMATION IN REGARD TO THE SUBJECT MATTER COVERED. IT IS SOLD ON THE UNDERSTANDING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING PROFESSIONAL SER VICES. IF PROFESSIONAL ADVICE OR OTHER EXPERT ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPE TENT PROFESSIONAL SHOULD BE SOUGHT. 978-1-119-99133-5 A catalogue record for this book is available from the British Library. Set in 10/14 Chaparral by Andrea Hornberger Printed in the United States of America by C J Krehbiel 01_9781119991335-ffirs.indd iv 3/28/11 12:44 PM About the Author JASON TYLER is passionate about technology and people. Jason teaches technology pro- fessionally to help people achieve their goals using the power of technology. He plays with technology because he loves the empowerment that technology can bring, and also because he is attracted to anything shiny. Jason is a lifetime student who considers a day wasted if he is not awed by something. His passion for technology has lead him to hold multiple certifi cations from Microsoft, Cisco, CompTIA, and ITIL. His passion for people led him to seek a B. A. in theology. Jason is an avid and dedicated photographer, sailor, and gamer. Of all the things he is, Jason is proudest to be the husband of Rebecca and the father of Liam and Declan. 01_9781119991335-ffirs.indd v 3/28/11 12:44 PM Credits Some of the people who helped bring this book to market include the following: Editorial and Production Marketing: VP Consumer and Technology Publishing Senior Marketing Manager: Louise Director: Michelle Leete Breinholt Associate Director- Book Content Marketing Executive: Kate Parrett Management: Martin Tribe Composition Services: Associate Publisher: Chris Webb Compositors: Andrea Hornberger, Publishing Assistant: Ellie Scott Jennifer Mayberry Development Editor: Linda Morris Proof Reader: Susan Hobbs Technical Editor: Liam Green-Hughes Indexer: Ty Koontz Copy Editor: Linda Morris Editorial Manager: Jodi Jensen Senior Project Editor: Sara Shlaer Editorial Assistant: Leslie Saxman 01_9781119991335-ffirs.indd vi 3/28/11 12:44 PM To Rebecca Sue. Th is is one of the high places I promised you. Th ank you for being there in the low places, too. 01_9781119991335-ffirs.indd vii 3/28/11 12:44 PM Author’s Acknowledgments Rebecca, thank you for the sacrifi ces you made to make this book possible. I love you. Forever. Liam and Declan, thank you for letting daddy write so much. Jon Bartolomeo, your honesty and grounded technical knowledge were invaluable. Bill Dwyer, thanks for the programming review and teaching. You are an amazing teacher. Hal Abelson, thank you so much for App Inventor and the years of dedication to the ethos behind it. You have become one of the giants. Th e App Inventor Google Developer team: Karen, Sharon, Liz, and Mark. Th ere are not enough superlatives to describe your contribution to leveling the Android application play- ing fi eld. Your enthusiasm, dedication, and downright rockstar-ness are unparalleled. Th e AI PowerUsers: Sua Th ov, Ed, Josh Turner, Shival, and Steve. I have grown and learned working with you guys. Rachael, you are the best boss to let me work on this so much. Chris Webb, I will be eternally grateful to you for giving me this opportunity and putting up with my author jitters. Linda, thank you so much for making me look good. Dennis Cohen, thanks for helping out with the Mac parts. Dad, thanks for getting me started in technology. Mom, thanks for educating me and making me love books, words, and excellence. I owe you the most. Finally, thanks to the rainy days that got me through all of the hard bits. 01_9781119991335-ffirs.indd viii 3/28/11 12:44 PM Contents About the Author . v Credits. .vi Author’s Acknowledgments . viii Introduction . 1 Who Th is Book Is For . 2 Part I: Getting Up and Running with Google App Inventor . 3 Part II: Designing Your Own Apps: Step-by-Step Guides . 3 Part III: Reference and Appendixes . 3 Downloadable Project Files and Bonus Content . 4 About Th is Book . 4 Part I CHAPTER 1 Building Your First App While Exploring the Interface . 7 Starting a New Project . 8 Getting Familiar with Design View . 12 Th e Palette column . 13 Th e Viewer column . 13 Th e Components column . 13 Media column . 14 Th e Properties column . 15 Adding Components to Your New Project . 15 Adding a Button component . 15 Adding a Label component . .17 Adding an Image component . .17 Adding a Sound component . .18 Renaming the Screen component . 20 Renaming the Image component . 21 Renaming the Label component . 21 Renaming the Button component. 21 Renaming the Sound component . 21 Adding sound for the Sound component . .22 Adding images for the Image component . 22 02_9781119991335-ftoc.indd ix 3/28/11 12:44 PM x APP INVENTOR FOR ANDROID Understanding properties . 23 Setting Image component properties . 24 Setting Label component properties . .25 Setting Button component properties . 27 Setting Sound component properties . .28 Introducing the Blocks Editor . 28 Previewing Built-in Blocks . 29 Placing Your Button Component Blocks . 31 Placing Your Sound Component Blocks . 31 Putting the fi nal touches on your project. 32 Saving your new application . 32 Th e Save As button . 33 Th e Checkpoint button . 33 Packaging your app . .34 Using the Show Barcode option . 34 Using the Download to Th is Computer option . 35 Using the Download to Connected Phone option . .35 Managing Your Projects . 35 Downloading your project source code . 37 Uploading your project source code . 38 Deleting a project . 39 Loading an existing project . 40 CHAPTER 2 Programming and Design Fundamentals . ..