indd i 28/07/12 6:10 PM PROFESSIONAL MOBILE APPLICATION DEVELOPMENT INTRODUCTION. xxiii CHAPTER 1 Preliminary Considerations. 1 CHAPTER 2 Diving into Mobile: App or Website?. 11 CHAPTER 3 Creating Consumable Web Services for Mobile Devices.
37 CHAPTER 4 Mobile User Interface Design. 89 CHAPTER 5 Mobile Websites. 117 CHAPTER 6 Getting Started with Android. 151 CHAPTER 7 Getting Started with iOS.
183 CHAPTER 8 Getting Started with Windows Phone 7. 229 CHAPTER 9 Getting Started with BlackBerry. 253 CHAPTER 10 Getting Started with Appcelerator Titanium. 283 CHAPTER 11 Getting Started with PhoneGap.
309 CHAPTER 12 Getting Started with MonoTouch and Mono for Android .indd i 09/08/12 7:15 PM ffirs.indd ii 09/08/12 7:15 PM PROFESSIONAL Mobile Application Development ffirs.indd iii 09/08/12 7:15 PM ffirs.indd iv 09/08/12 7:15 PM PROFESSIONAL Mobile Application Development Jeff McWherter Scott Gowell John Wiley & Sons, Inc.indd v 09/08/12 7:15 PM Professional Mobile Application Development Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.com Copyright © 2012 by John Wiley & Sons, Inc., Indianapolis, Indiana Published simultaneously in Canada ISBN: 978-1-118-20390-3 ISBN: 978-1-118-22842-5 (ebk) ISBN: 978-1-118-24068-7 (ebk) ISBN: 978-1-118-26551-2 (ebk) Manufactured in the United States of America 10 9 8 7 6 5 4 3 2 1 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, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.com/go/permissions. Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose.
No warranty may be created or extended by sales or pro- motional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought.
Neither the pub- lisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read. For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with stan- dard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport. For more information about Wiley products, visit www.
Library of Congress Control Number: 2012940037 Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are trade- marks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.indd vi 09/08/12 7:15 PM To my daughter Abigail Grace: I will help you to succeed in anything you choose to do in life.
—Jeff McWherter For Barbara and Charlotte, I couldn’t have done it without you. —Scott Gowell ffirs.indd vii 09/08/12 7:15 PM ffirs.indd viii 09/08/12 7:15 PM ABOUT THE AUTHORS JEFF MCWHERTER wrote Chapters 2, 7, 9 and 12. He is a partner at Gravity Works Design and Development and manages the day-to-day activities of the development staff. Jeff graduated from Michigan State University with a degree in Telecommunications, and has 15 years of professional experience in software development.
He is a founding member of the Greater Lansing Users for. He enjoys profiling code, applying design patterns, fi nding obscure namespaces, and long walks in the park. His lifelong interest in programming began with a Home Computing Magazine in 1983, which included an article about writing a game called Boa Alley in BASIC. Jeff currently lives in a farming community near Lansing, MI.
When he is not in front of the computer he enjoys Lego, Snowboarding, board games, salt-water fish and spending time with his beautiful wife Carla and daughter Abigail Grace. SCOTT GOWELL wrote Chapters 1, 6 and 10. He is Senior Developer at Gravity Works Design and Development. Scott graduated from Northern Michigan University with a degree in Network Computing, and has been working as a professional in software development since Spring of 2003.
Scott lives with his wife Barbara and their daughter Charlotte. When not working he loves spending time with his family, playing with Duplo and dinosaurs or snuggling up on the couch to watch a movie. ABOUT THE CONTRIBUTORS DAVID SILVA SMITH wrote Chapter 3. Dave is Director of Business Development at Gravity Works Design and Development.
Dave has been creating websites and writing code since he was in 7th grade. Dave is happy he can use his technology skills to work with customers proposing solutions to their problems and proposing ways for them to capitalize on business opportunities. Dave graduated from Michigan State University and serves as a board member on a number of professional organi- zations in the Lansing area. When Dave is not working he enjoys spending time with his son Colin.
Dave also enjoys playing football, basketball, and volleyball. LAUREN THERESE GRACE COLTON wrote Chapter 4. Lauren is a geek fascinated by how people inter- act with technology to fi nd and use information. A graduate of James Madison College at Michigan State University, her editorial work includes the International Encyclopedia of the Social Sciences ffirs.indd ix 09/08/12 7:15 PM x ❘ ABOUT THE AUTHORS and the Encyclopedia of Modern China.
During much of her time spent working on this book, her husband Adam was cooking homemade pizza, while her lovely pit bulls Maggie and Beatrice cuddled at her feet. AMELIA MARSCHALL-MILLER wrote Chapter 5. Amelia is Partner and Creative Director at Gravity Works Design and Development. She holds a Bachelors degree from Northern Michigan University in Graphic Design and Marketing.
Amelia has over five years of graphic and web design experience and is continually exploring the latest techniques in website design. She has spoken at regional and national conferences about front end web technologies, including HTML5, CSS3, and the mobile web. She is one of the rare designers who likes to code. (Or, one of the rare coders who likes to design!) When she is not designing or building websites, Amelia enjoys swimming and competing in triathlons, and going on camping and ski trips with her husband John.
ADAM RYDER wrote Chapter 11. He is a developer at Gravity Works Design and Development. He has a Bachelors of Science from Lake Superior State University in Computer Science. When Adam is not working he enjoys spending time with his family.
He fishes regularly and spends time camping in Michigan’s State Park system with his fiancée, Alicia, and yellow lab, Jasper.indd x 09/08/12 7:15 PM CREDITS EXECUTIVE EDITOR PRODUCTION MANAGER Carol Long Tim Tate PROJECT EDITOR VICE PRESIDENT AND EXECUTIVE GROUP Brian Herrmann PUBLISHER Richard Swadley TECHNICAL EDITOR Al Scherer VICE PRESIDENT AND EXECUTIVE PUBLISHER Neil Edde PRODUCTION EDITOR Christine Mugnolo ASSOCIATE PUBLISHER Jim Minatel COPY EDITOR Kimberly A. Cofer PROJECT COORDINATOR, COVER Katie Crocker EDITORIAL MANAGER Mary Beth Wakefield PROOFREADER Mark Steven Long FREELANCER EDITORIAL MANAGER Rosemarie Graham INDEXER Robert Swanson ASSOCIATE DIRECTOR OF MARKETING David Mayhew COVER DESIGNER LeAndra Young MARKETING MANAGER Ashley Zurcher COVER IMAGE © iStock / kokouu BUSINESS MANAGER Amy Knies ffirs.indd xi 09/08/12 7:15 PM ffirs.indd xii 09/08/12 7:15 PM ACKNOWLEDGMENTS THE SUCCESS OF THIS BOOK came from the dedication of the entire team at Gravity Works Design and Development. With Jeff and Scott acting as lead authors and co-conductors, an orchestra of highly passionate individuals — Amelia, Lauren, Dave, and Adam — spent countless hours researching and working on portions of this book to ensure it maintained high standards and contained expertise on topics from those who know them best. Professional Mobile Application Development provides the collective knowledge from all of us at Gravity Works.
Throughout the years, the whole Gravity Works team has had the opportunity to attend hundreds of conferences and user groups targeted at developers, designers, and user interface experts. It is at these events that we meet other passionate people and learn new things. We would like to thank the organizers of these events, and encourage others to host more events on emerging technologies. Finally, a huge thank you to our families.
Your patience while we worked late nights and weekends at Gravity Works, in local coffee shops, and on our kitchen tables will not be forgotten! ffirs.indd xiii 09/08/12 7:15 PM ffirs.indd xiv 09/08/12 7:15 PM CONTENTS INTRODUCTION xxiii CHAPTER 1: PRELIMINARY CONSIDERATIONS 1 Why You Might Be Here 2 Competition 2 Quality vs. Time to Market 2 Legacy System Integration 2 Mobile Web vs. Mobile App 3 Cost of Development 3 Hardware 3 Software 4 Licenses and Developer Accounts 5 Documentation and APIs 5 The Bottom Line 6 Importance of Mobile Strategies in the Business World 6 Why Is Mobile Development Difficult? 6 Mobile Development Today 8 Mobile Myths 8 Third-Party Frameworks 9 Appcelerator Titanium Mobile Framework 9 Nitobi PhoneGap 10 MonoDroid and MonoTouch 10 Summary 10 CHAPTER 2: DIVING INTO MOBILE: APP OR WEBSITE? 11 Mobile Web Presence 12 Mobile Content 13 Mobile Browsers 14 Mobile Applications 17 You’re a Mobile App If. 17 When to Create an App 18 Benefits of a Mobile App 22 ftoc.indd xv 28/07/12 6:10 PM CONTENTS Marketing 24 Quick Response Codes 25 The Advertising You Get from the App Market 26 Third-Party Markets 32 Your App as a Mobile Web App 33 Summary 36 CHAPTER 3: CREATING CONSUMABLE WEB SERVICES FOR MOBILE DEVICES 37 What Is a Web Service? 37 Examples of Web Services 38 Advantages of Web Services 39 Web Services Languages (Formats) 40 eXtensible Markup Language (XML) 40 JavaScript Object Notation (JSON) 42 Transferring Nontextual Data 42 Creating an Example Web Service 42 Using the Microsoft Stack 43 Using the Linux Apache MySQL PHP (LAMP) Stack 77 Debugging Web Services 83 Tools 83 Advanced Web Service Techniques 85 Summary 86 CHAPTER 4: MOBILE USER INTERFACE DESIGN 89 Effective Use of Screen Real Estate 90 Embrace Minimalism 90 Use a Visual Hierarchy 90 Stay Focused 90 Understanding Mobile Application Users 91 Proximity 91 Closure 91 Continuity 92 Figure and Ground 92 Similarity 92 The Social Aspect of Mobile 92 Usability 93 Accessibility 94 Understanding Mobile Information Design 96 Information Display 96 Design Patterns 96 xvi ftoc.