www.it-ebooks.info ffirs.indd iffirs.indd i 28/07/12 6:10 PM28/07/12 6:10 PM www.it-ebooks.info 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 . . . . . . . . . . . 343 INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 ffirs.indd iffirs.indd i 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info ffirs.indd iiffirs.indd ii 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info PROFESSIONAL Mobile Application Development ffirs.indd iiiffirs.indd iii 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info ffirs.indd ivffirs.indd iv 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info John Wiley & Sons, Inc. PROFESSIONAL Mobile Application Development Jeff McWherter Scott Gowell ffirs.indd vffirs.indd v 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info Professional Mobile Application Development Published by John Wiley & Sons, Inc. 10475 Crosspoint Boulevard Indianapolis, IN 46256 www.wiley.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.wiley.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 specifi cally disclaim all warranties, including without limitation warranties of fi tness 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.wiley.com. For more information about Wiley products, visit www.wiley.com. 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. ffirs.indd viffirs.indd vi 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info 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 viiffirs.indd vii 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info ffirs.indd viiiffirs.indd viii 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info [...]... to Build a Mobile App ➤ Costs of Developing a Mobile App ➤ Importance of Developing a Mobile Strategy ➤ Difficulties in Mobile App Development ➤ Mobile Application Development Today ➤ Myths of Mobile Application Design ➤ Explanation of Third-Party Mobile Frameworks This book is for any developer or team that needs to create, refi ne, or strengthen their mobile development strategy From a development. .. Cost of Development ❘ 3 Mobile Web vs Mobile App You may not need a mobile application; you may need a mobile website Chapter 2 discusses how to determine whether you need a mobile website or a mobile app more in depth Now that the major reasons for looking into mobile app development have been covered, the next section discusses the costs you can expect to incur when taking on mobile application development. .. platform requirements for creating mobile applications What This Book Covers Professional Mobile Application Development covers the key concepts needed to develop mobile apps and mobile websites, using a variety of platforms and technologies: ➤ Whether to develop an app or a mobile website ➤ Why a mobile presence is important ➤ Mobile user interfaces design concepts ➤ Creating mobile web apps using responsive... Time to Market Legacy System Integration Mobile Web vs Mobile App 2 2 2 3 Cost of Development 3 Hardware Software Licenses and Developer Accounts Documentation and APIs The Bottom Line Importance of Mobile Strategies in the Business World Why Is Mobile Development Difficult? Mobile Development Today Mobile Myths Third-Party Frameworks Appcelerator Titanium Mobile Framework Nitobi PhoneGap MonoDroid... discusses the tools, techniques, best practices, advantages, and disadvantages of each mobile development platform How This Book Is Structured Many readers of Professional Mobile Application Development will not have any experience with creating any type of mobile application, whereas others may have experience with some types of mobile platforms presented in this book After the fi rst few chapters, which are... developing for a variety of mobile devices If you are reading this, you are interested in learning about mobile development; we hope to give you the information and tools to start down the best path to develop a mobile application Who This Book Is For This book is targeted at anyone interested in mobile development We assume the reader is a technical professional with some type of development experience... CHAPTER 2: DIVING INTO MOBILE: APP OR WEBSITE? Mobile Web Presence 11 12 Mobile Content Mobile Browsers 13 14 Mobile Applications 17 You’re a Mobile App If When to Create an App Benefits of a Mobile App 17 18 22 www.it-ebooks.info ftoc.indd xv 28/07/12 6:10 PM CONTENTS Marketing 24 Quick Response Codes The Advertising You Get from the App Market Third-Party Markets Your App as a Mobile Web App Summary... Current Website Accommodate? How Much Do You Want to Provide for Mobile Users? 117 118 118 118 119 Adaptive Mobile Websites 120 Get Your Queries in Place Add Mobile Styles 121 125 Dedicated Mobile Websites Mobile Web Apps with HTML5 What Exactly Is HTML5? And What Exactly Is a Mobile Web App? How Do You Use HTML5 in a Mobile Web App? Make Your Mobile Web App Even More Native Summary 140 143 143 144 144... into Mobile: App or Website? One of the most heated topics in the mobile world today is whether to design a mobile app or a mobile website, and this chapter is devoted entirely to this topic After reading this chapter, you will have a good understanding of when you should develop a mobile app, and when a mobile website is sufficient Chapter 3: Creating Consumable Web Services for Mobile Devices Most mobile. .. read about mobile development for the platforms that are relevant to them, independent of other chapters Chapter 1: Preliminary Considerations This chapter starts with an introduction to what it takes to develop mobile apps Mobile development is a hot trend right now, and many companies are jumping in, spending time developing a mobile strategy With so many options available to develop mobile apps, . Inc. PROFESSIONAL Mobile Application Development Jeff McWherter Scott Gowell ffirs.indd vffirs.indd v 09/08/12 7:15 PM09/08/12 7:15 PM www.it-ebooks.info Professional Mobile Application Development Published. 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 Benefi ts of a Mobile. Strategies in the Business World 6 Why Is Mobile Development Di cult? 6 Mobile Development Today 8 Mobile Myths 8 Third-Party Frameworks 9 Appcelerator Titanium Mobile Framework 9 Nitobi PhoneGap 10 MonoDroid