Sams Teach Yourself Android Application Development in 24 Hours, Second Edition
Lauren Darcey
Shane Conder
800 East 96th Street, Indianapolis, Indiana, 46240 USA
Sams Teach Yourself Android Application Development in 24 Hours, Second Edition
Copyright 2012 by Lauren Darcey and Shane Conder
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-672-33569-3
ISBN-10: 0-672-33569-7
Library of Congress Cataloging-in-Publication Data
Darcey, Lauren, 1977
Sams teach yourself Android application development in 24 hours /
Lauren Darcey, Shane Conder. -- 2nd ed.
p. cm.
ISBN 978-0-672-33569-3 (pbk. : alk. paper)
1. Application software--Development. 2. Android (Electronic
resource) 3. Mobile computing. I. Conder, Shane, 1975- II. Title. III.
Title: Teach yourself Android application development in twenty-four
hours.
QA76.76.A65D26 2012
004--dc23
2011025487
Printed in the United States of America
First Printing August 2011
Editor in Chief
Mark Taub
Acquisitions Editor
Trina MacDonald
Development Editor
Sheri Cain
Managing Editor
Sandra Schroeder
Project Editor
Mandie Frank
Copy Editor
Charlotte Kughen, The Wordsmithery LLC
Indexer
Larry Sweazy
Proofreader
Williams Woods Publishing Services
Technical Editor
Jim Hathaway
Publishing Coordinator
Olivia Basegio
Designer
Gary Adair
Compositor
Bronkella Publishing
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an as is basis. The authors and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Bulk Sales
Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
For sales outside of the U.S., please contact
International Sales
About the Authors
Lauren Darcey is responsible for the technical leadership and direction of a small software company specializing in mobile technologies, including Android, iPhone, BlackBerry, Palm Pre, BREW, and J2ME, and consulting services. With more than two decades of experience in professional software production, Lauren is a recognized authority in enterprise architecture and the development of commercial-grade mobile applications. Lauren received a B.S. in Computer Science from the University of California, Santa Cruz.
She spends her copious free time traveling the world with her geeky mobile-minded husband. She is an avid nature photographer, and her work has been published in books and newspapers around the world. In South Africa, she dove with 4-meter-long great white sharks and got stuck between a herd of rampaging hippopotami and an irritated bull elephant. Shes been attacked by monkeys in Japan, gotten stuck in a ravine with two hungry lions in Kenya, gotten thirsty in Egypt, narrowly avoided a coup dtat in Thailand, geocached her way through the Swiss Alps, drank her way through the beer halls of Germany, slept in the crumbling castles of Europe, and gotten her tongue stuck to an iceberg in Iceland (while being watched by a herd of suspicious wild reindeer).
Shane Conder has extensive development experience and has focused his attention on mobile and embedded development for the past decade. He has designed and developed many commercial applications for Android, iPhone, BREW, BlackBerry, J2ME, Palm, and Windows Mobilesome of which have been installed on millions of phones worldwide. Shane has written extensively about the mobile industry and evaluated mobile development platforms on his tech blogs and is well known within the blogosphere. Shane received a B.S. in Computer Science from the University of California.
A self-admitted gadget freak, Shane always has the latest phone, laptop, or other mobile device. He can often be found fiddling with the latest technologies, such as cloud services and mobile platforms, and other exciting, state-of-the-art technologies that activate the creative part of his brain. He also enjoys traveling the world with his geeky wife, even if she did make him dive with 4-meter-long great white sharks and almost get eaten by a lion in Kenya. He admits that he has to take at least two phones and a tablet with him when backpacking, even though there is no coverage, that he snickered and whipped out his Android phone to take a picture when his wife got her tongue stuck to that iceberg in Iceland, and that he is catching on that he should be writing his own bio.
The authors have also published an intermediate/advanced book on Android development called Android Wireless Application Development, Second Edition, part of the Addison-Wesley Developers Library series. Lauren and Shane have also published numerous articles on mobile software development for magazines, technical journals, and online publishers of educational content. You can find dozens of samples of their work in Smart Developer magazine (Linux New Media), Developer.com, Network World, Envato (MobileTuts+ and CodeCanyon), and InformIT, among others. They also publish articles of interest to their readers at their own Android website, http://androidbook.blogspot.com. You can find a full list of the authors publications at http://goo.gl/f0Vlj.
Dedication
For Chickpea.
Acknowledgments
This book would never have been written without the guidance and encouragement we received from a number of very patient and supportive people, including our editorial team, co-workers, friends, and family.
Throughout this project, our editorial team at Pearson (Sams Publishing) has been top notch. Special thanks go to Trina MacDonald, Olivia Basegio, and Sheri Cain. Our technical reviewer, Jim Hathaway, helped us ensure that this book provides accurate information. With each edition, this book gets better. However, it wouldnt be here without the help of many folks on past editions. Thanks go out to past reviewers, technical editors, and readers for their valuable feedback. Finally, wed like to thank our friends and family members who supported us when we needed to make our book deadlines.