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 platforms and broaden the interest and audience of your app, without working with burdensome and error-prone compatibility layers and toolkits. Cracking iPhone and Android Native Development takes you, the developer, through the same mobile software development project on both platforms, learning the differences between and the relative strengths and weaknesses of each platform as you go. No magic intermediate layers of obfuscation—by the time you get to the end, you'll be an expert at developing for any of the major smartphone platforms using each vendor's preferred toolset and approach. Cracking iPhone and Android Native Development covers the iPhone and Android platforms, two of the hottest mobile device platforms on the market today. What you’ll learn How to develop, end-to-end, the same application on iPhone and Android platforms. The different service architectures available on each platform, concentrating on services related to storage, communications and security. Key differences in deploying and managing applications on the various platforms. How to translate experience at developing on one platform to speed development when attempting a project on a different platform. Plus, stay on top of developments in the mobile application space by visiting the author's comprehensive resource site at http://www.multimobiledevelopment.com Who this book is for Cracking iPhone and Android Native Development is the essential book for software developers looking to build applications that run natively, without cumbersome compatibility layers and toolkits, on the iPhone and Android platforms. Table of Contents Introduction The Six Bookmarks Server Service Application Architecture and Functional Specification Android: Installing the Toolset Android: Building the Logon Form and Consuming REST Services Android: An ORM Layer on SQLite Android: Pushing Changes to the Server iOS: Installing the Toolset iOS: Building the Logon Form and Consuming REST Services iOS: An ORM Layer on SQLite iOS: Pushing Changes Back to the Server iOS: MonoTouch
Author(s): Matthew Baxter-Reynolds
Edition: 1
Publisher: Apress
Year: 2010
Language: English
Pages: 480
Prelim......Page 1
Contents at a Glance......Page 7
Contents......Page 9
About the Author......Page 15
About the Technical Reviewer......Page 16
Acknowledgments......Page 17
Introduction......Page 19
How Is This Book Structured?......Page 20
Conclusion......Page 22
Creating an API Account......Page 23
Creating a User......Page 24
RESTful Web Services......Page 26
Examining Logon Operations......Page 27
Obtaining a Token......Page 28
Cleaning Up......Page 29
Adding Some Test Data......Page 30
Working with OData......Page 31
OData Queries......Page 35
Conclusion......Page 36
Functional Specification......Page 37
Synchronizing......Page 38
Navigator......Page 39
Configuring Bookmarks......Page 40
Missing Functionality......Page 41
Approach......Page 42
Metadata......Page 43
Entities......Page 44
Generating Entities......Page 45
SQL Statements......Page 46
Server Communication......Page 47
Technical Approach Broken Down by Platform......Page 48
Issue HTTP Requests......Page 49
Write an XML Document......Page 50
Conclusion......Page 51
Installing Java......Page 53
Bug in the “r05” Installer......Page 54
Installing the Android Development Tools (ADT) into Eclipse......Page 55
Configuring the Emulator......Page 59
Creating Our Android “Hello, World” Application......Page 62
Declarative Layout......Page 65
Wiring Up the Button......Page 67
Conclusion......Page 72
Creating the Project......Page 73
Conventions for Presenting Code......Page 74
Issuing Web Requests......Page 75
The “Download” and “DownloadXml” Methods......Page 76
Extra Methods on “HttpHelper”......Page 79
Authenticating Our API Account......Page 80
The “LogonResponse”......Page 82
Building the “XmlHelper” Class......Page 83
Creating the “Logon” Method on the API Service......Page 87
Wiring Up “EnsureApiAuthenticated”......Page 90
Authenticating the User via “UsersService”......Page 91
Setting “Allow Internet Access” Permission......Page 92
Creating the Logon Form......Page 93
Contexts and Building the Controller......Page 97
Binding the View and Controller......Page 100
Logging On......Page 104
“Remember Me”......Page 107
Conclusion......Page 109
Entities......Page 111
“EntityType”......Page 112
Creating the Basic “Entity” Class......Page 118
Setting Values in an Entity......Page 120
Building “Bookmark”......Page 125
Registering the “EntityType”......Page 127
Creating the Form......Page 128
Creating the “Navigator.xml” Layout......Page 129
Creating the Controller......Page 131
Creating the View Interface......Page 132
Creating the Navigator Activity......Page 133
Showing the Bookmarks......Page 135
Issuing the “Go to Navigator” “Intent”......Page 138
Wiring Up the Bookmarks......Page 140
Calling the Server’s Bookmarks OData Service......Page 142
Namespaces......Page 143
Adding Functionality to “XmlHelper”......Page 144
Querying the Feed......Page 145
Creating Entities from Name/Value Collections......Page 149
Managing the Database......Page 150
The “SqlStatement” Class and “ISqlStatementSource” Interface......Page 152
Creating Tables......Page 153
Examining the Database with Sqliteman......Page 157
Building the Change Processor......Page 161
Inserting Entities......Page 162
Downloading Bookmarks......Page 164
Reading Bookmarks and Displaying Them on the Navigator......Page 166
Executing the Entity Collection......Page 168
Asking the Navigator Controller to Load the Real Bookmarks......Page 170
Conclusion......Page 171
Constraining SQL Filters......Page 173
Excluding Deleted Entities from the View......Page 179
Getting a Bookmark by Ordinal......Page 180
List Views......Page 181
Binding List Data......Page 186
Selecting Items for Editing......Page 191
Implementing Menus......Page 194
Handling Menu Actions......Page 196
Creating the Context Menu......Page 198
Configuring Singletons......Page 204
Building the “PushUpdates” Method......Page 212
Issuing Server Requests to Insert, Update, and Delete......Page 216
Marking Fields As Being Available on the Server......Page 217
Building the XML......Page 219
Building “ExecuteODataOperation”......Page 222
Conclusion......Page 227
An Objective-C Primer for .NET and Java Developers......Page 229
Problems with Objective-C......Page 230
Creating the Project......Page 231
Properties (and a Little Memory Management)......Page 233
A Little More about Memory Management......Page 238
Methods......Page 239
“Hello, World” for iPhone......Page 241
Building the User Interface......Page 243
Creating a Windows and Showing the View......Page 250
Displaying the Message Box......Page 251
Conclusion......Page 253
Creating the Logon Form......Page 255
Creating the Logon Form User Interface......Page 257
Showing the Logon Form......Page 260
Conventions for Presenting Code in the iPhone Chapters......Page 264
Capturing the Logon Request......Page 265
Calling the API Service......Page 270
Building the Proxy Classes......Page 271
The SBHttpHelper and SBDownloadBucket Classes......Page 272
Implementing SBDownloadBucket......Page 275
Making a Real Call to the API Service and Parsing the XML......Page 281
Calling the Users Service......Page 299
Notifying That Work Is in Progress......Page 305
Conclusion......Page 307
Entities......Page 309
The SBEntityType Class......Page 310
The SBEntity Class......Page 318
Setting Values in an Entity......Page 321
Building SBBookmark......Page 326
Creating SBEntityType Instances......Page 329
Creating the View......Page 331
Building the View Engine......Page 335
Displaying Bookmarks......Page 340
Handling Navigation......Page 343
Calling the Server’s Bookmarks OData Service......Page 345
Querying the Feed......Page 347
Stubbing SBSync......Page 350
Parsing the XML......Page 354
Spinning the Progress Wheel......Page 361
Including SQLite......Page 362
Building SBDBHelper and Implementing Error Handling......Page 365
Defining SQL Statements......Page 367
Creating Tables......Page 369
Storing the Database in the Correct Location......Page 378
Building the Change Processor......Page 379
Completing getLatest......Page 384
Reading Bookmarks and Displaying Them on the Navigator......Page 386
Conclusion......Page 398
Configuring Bookmarks......Page 399
Putting Data on the Table......Page 402
Sorting the Bookmarks......Page 405
Singleton View......Page 406
Editing a Bookmark......Page 411
Capturing and Committing Changes......Page 414
Implementing the Delete Method......Page 418
Adding a Bookmark......Page 419
Deleting Bookmarks......Page 421
Manually Syncing......Page 424
Pushing Changes to the Server......Page 425
Work Items......Page 428
Issuing OData Change Requests......Page 434
Flagging Fields As “Not on Server”......Page 435
Issuing Requests......Page 436
Implementing executeODataOperation......Page 440
Modifying processWorkItems......Page 442
Conclusion......Page 444
Mono in the Big Picture......Page 445
Installing MonoTouch......Page 446
“Hello, World”......Page 447
Inspecting the Code-Behind......Page 450
Wiring Up the Button......Page 452
Running the Project......Page 453
Creating the Project......Page 454
Building ServiceProxy Et Al.......Page 455
Calling the Service Method......Page 460
Conclusion......Page 464
¦A......Page 465
¦B......Page 466
¦D......Page 467
¦E......Page 468
F......Page 469
¦H......Page 470
¦I......Page 471
¦ L......Page 472
¦O......Page 473
¦R......Page 475
¦S......Page 476
U......Page 479
¦X......Page 480