ebook img

Multimobile Development: Building Applications for the iPhone and Android Platforms (Books for Professionals by Professionals) PDF

481 Pages·2010·8.41 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Multimobile Development: Building Applications for the iPhone and Android Platforms (Books for Professionals by Professionals)

BOOKS FOR PROFESSIONALS BY PROFESSIONALS® Companion eBook Available Discover developing an application M S ultimobile Development: Building Applications for iPhone and Android is end-to-end natively E M L T the essential book if you want to learn how to natively target the iOS TI D and Android mobile platforms. You’ll wall through the process of building TE the same application on both platforms, learning the diff erences and rela- u A L tive strengths and weaknesses of each. You’ll also get answers to the most RE l common questions developers have, and get you a leg up into understanding t the platforms so that you can get on and do the clever thing that only you’ve i thought of. m Each section starts by looking at installing the toolset and building a “Hello, World” application to get comfortable. Then, you learn to build a proper, end-to-end appli- o cation that involves Internet communication over HTTP up to a public cloud-based service, local storage using SQLite, a custom object-relational mapping layer and a b device-specific user interface. The sections are preceded with a detailed section of i the cloud-based service implementation, as well as the application architecture and l functional specification. There’s also a bonus chapter on MonoTouch. e You’ll learn: • D How to develop, end-to-end, the same application on iPhone and Android platforms. e • The diff erent service architectures available on each platform, v concentrating on services related to storage, communications and e security. • l Key diff erences in deploying and managing applications on the o various platforms. • How to translate experience at developing on one platform to speed p Multimobile development when attempting a project on a diff erent platform. m All of the code is available on GitHub and is licensed under the Mozilla Public License (MPL ) open source license should you wish to use any of it in your own applications. e You will also find support resources at http://www.multimobiledevelopment.com/ to help you get the most out of the book. n Development t Matthew Baxter-Reynolds works as an independent software development consultant helping business achieve more from their software teams. His particular interests lie in open standards, the B Microsoft server stack and the “big four” mobile computing platforms. a x t e r Building Applications for iPhone and Android - R e y n o ld Matthew Baxter-Reynolds COMPANION eBOOK SEE LAST PAGE FOR DETAILS ON $10 eBOOK VERSION s Shelve in Mobile Computing SOURCE CODE ONLINE User level: www.apress.com Beginning–Advanced Baxter/Reynolds 3198-1 LSI.indd 1 9/15/10 3:46 PM Multimobile Development Building Applications for the iPhone and Android Platforms ■ ■ ■ Matthew Baxter-Reynolds Multimobile Development: Building Applications for the iPhone and Android Platforms Copyright © 2010 by Matthew Baxter-Reynolds All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-3198-1 ISBN-13 (electronic): 978-1-4302-3199-8 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. President and Publisher: Paul Manning Lead Editor: Jonathan Hassell Technical Reviewer: Matthew Fitchett Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Anita Castro Copy Editor: Mary Ann Fugate Compositor: Lynn L’Heureux Indexer: Potomac Indexing, LLC Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. For information on translations, please e-mail [email protected], or visit www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. 0x34 0x4D 0x2B 0x45 ■CONTENTS Contents at a Glance ■About the Author.................................................................................................................xiii ■About the Technical Reviewer............................................................................................xiv ■Acknowledgements.............................................................................................................xv ■Chapter 1: Introduction..........................................................................................................1 ■Chapter 2: The Six Bookmarks Server Service.....................................................................5 ■Chapter 3: Application Architecture and Functional Specification...................................19 ■Chapter 4: Android: Installing the Toolset..........................................................................35 ■Chapter 5: Android: Building the Logon Form and Consuming REST Services.................55 ■Chapter 6: Android: An ORM Layer on SQLite....................................................................93 ■Chapter 7: Android: Pushing Changes to the Server.......................................................155 ■Chapter 8: iOS: Installing the Toolset................................................................................211 ■Chapter 9: iOS: Building the Logon Form and Consuming REST Services......................237 ■Chapter 10: iOS: An ORM Layer on SQLite.........................................................................291 ■Chapter 11: iOS : Pushing Changes Back to the Server..................................................381 ■Chapter 12: iOS: MonoTouch.............................................................................................427 ■Index...................................................................................................................................447 v ■CONTENTS Contents ■About the Author.................................................................................................................xiii ■About the Technical Reviewer............................................................................................xiv ■Acknowledgements.............................................................................................................xv ■Chapter 1: Introduction..........................................................................................................1 What’s the Purpose of This Book?............................................................................................2 How Is This Book Structured?...................................................................................................2 Where Can You Get Help and Support?.....................................................................................4 Conclusion...............................................................................................................................4 ■Chapter 2: The Six Bookmarks Server Service.....................................................................5 Creating an API Account...........................................................................................................5 Creating a User..................................................................................................................6 The Users Service....................................................................................................................8 RESTful Web Services........................................................................................................8 Testing the Calls................................................................................................................9 Examining Logon Operations..............................................................................................9 The Bookmarks Service..........................................................................................................12 Adding Some Test Data...................................................................................................12 Working with OData.........................................................................................................13 OData Queries.................................................................................................................17 Issuing Updates over OData.............................................................................................18 Constraining Data to the Logged-On User........................................................................18 Conclusion.............................................................................................................................18 vii ■CONTENTS ■Chapter 3: Application Architecture and Functional Specification...................................19 A Word About Slates...............................................................................................................19 Functional Specification.........................................................................................................19 Logging On......................................................................................................................20 Synchronizing..................................................................................................................20 Navigator.........................................................................................................................21 Configuring Bookmarks....................................................................................................22 Configuring a Single Bookmark (“Configure Singleton”)...................................................23 Missing Functionality.......................................................................................................23 Application Architecture and Technical Specification..............................................................24 Approach.........................................................................................................................24 Object-Relational Mapping...............................................................................................25 Server Communication.....................................................................................................29 Technical Approach Broken Down by Platform.................................................................30 Conclusion.............................................................................................................................33 ■Chapter 4: Android: Installing the Toolset..........................................................................35 Why Android First?.................................................................................................................35 Installing the Toolset..............................................................................................................35 Installing Java..................................................................................................................35 Installing Eclipse..............................................................................................................36 Installing the Android SDK................................................................................................36 Installing the Android Development Tools (ADT) into Eclipse.............................................37 Configuring the Emulator........................................................................................................41 Creating Our Android “Hello, World” Application.....................................................................44 Saying “Hello, World”......................................................................................................47 Declarative Layout...........................................................................................................47 Wiring Up the Button........................................................................................................49 Conclusion.............................................................................................................................54 ■Chapter 5: Android: Building the Logon Form and Consuming REST Services.................55 Creating the Project................................................................................................................55 Conventions for Presenting Code............................................................................................56 Calling RESTful Services.........................................................................................................57 Issuing Web Requests......................................................................................................57 Authenticating Our API Account........................................................................................62 viii

Description:
You've developed a killer app for one mobile device—now it’s time to maximize your intellectual investment and develop for the full spectrum of mobile platforms and devices. With Cracking iPhone and Android Native Development, you’ll learn how to quickly retool between the iPhone and Android p
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.