Learning MIT App Inventor

 Learning MIT App Inventor

Addison-Wesley Learning Series

Visit learningseries for a complete list of available publications.

The Addison-Wesley Learning Series is a collection of hands-on programming guides that help you quickly learn a new technology or language so you can apply what you've learned right away. Each title comes with sample code for the application or applications built in the text. This code is fully annotated and can be reused in your own projects with no strings attached. Many chapters end with a series of exercises to encourage you to reexamine what you have just learned, and to tweak or adjust the code as a way of learning. Titles in this series take a simple approach: they get you going right away and leave you with the ability to walk off and build your own application and apply the language or technology to whatever you are working on.

Learning MIT App Inventor

A Hands-On Guide to Building Your Own Android Apps

Derek Walter Mark Sherman

Upper Saddle River, NJ ? Boston ? Indianapolis ? San Francisco New York ? Toronto ? Montreal ? London ? Munich ? Paris ? Madrid

Cape Town ? Sydney ? Tokyo ? Singapore ? Mexico City

Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.

The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.

For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and content particular to your business, training goals, marketing focus, or branding interests), please contact our corporate sales department at corpsales@ or (800) 382-3419.

For government sales inquiries, please contact governmentsales@.

For questions about sales outside the U.S., please contact international@.

Visit us on the Web: aw

Library of Congress Control Number: 2014950962

Copyright ? 2015 Pearson Education, Inc.

All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.

Android, Google Play, Google, and the Google logo are registered trademarks of Google Inc., used with permission.

All content from the Android Developer site and Android Open Source Project are licensed under a Creative Commons Attribution 2.5 license.

MIT App Inventor is a trademark of the Massachusetts Institute of Technology.

All content from MIT App Inventor is licensed under a Creative Commons Attribution-- ShareAlike 3.0 Unported License.

ISBN-13: 978-0-133-79863-0 ISBN-10: 0-133-79863-1

Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana.

First printing: December 2014

Editor-in-Chief Mark Taub

Executive Editor Laura Lewin

Senior Development Editor Chris Zahn

Managing Editor Kristy Hart

Project Editor Elaine Wiley

Copy Editor Krista Hansing Editorial Services, Inc.

Indexer Lisa Stumpf

Proofreader Debbie Williams

Technical Reviewers Tom Stokke Arta Szathma Janet BrownSederberg

Editorial Assistant Olivia Basegio

Cover Designer Chuti Prasertsith

Compositor Nonie Ratcliff

from Derek This book is dedicated to my incredible wife, Candy.

from Mark This book is dedicated to Stacy (depending on what she says).

This page intentionally left blank

Contents vii

Table of Contents

Preface xiv

1 An Introduction to Programming 1 Operating Systems 2 User Interface 4 Android Strengths 6 Extending App Capabilities 8 Google Services 9 Applications 10 Programming Languages 11 Summary 13 Exercises 14

2 Building with MIT App Inventor 17 The MIT App Inventor Site 17 Signing In 18 Designer 20 Blocks Editor 20 The AI2 Companion App 21 The Android Emulator 23 USB Connection to Android Device 23 Getting Inside an App 25 Event Handlers 25 Doing One Thing at a Time 26 Exercise: Sherlock Is Watching 27 Adding an Image 29 What Can You Build? 31 Speak, Android! 31 Pollock 31 Fore 32 Android Quiz 32 Uploading to Google Play 32 Summary 33 Exercises 34

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download