Salesforce Mobile SDK Development Guide - · PDF fileYou get all three features in Mobile SDK...
date post
07-Feb-2018Category
Documents
view
237download
4
Embed Size (px)
Transcript of Salesforce Mobile SDK Development Guide - · PDF fileYou get all three features in Mobile SDK...
Version 28.0: Summer 13
Salesforce Mobile SDK Development GuideSalesforce.com Mobile Development
Last updated: July 9, 2013
Copyright 20002013 salesforce.com, inc. All rights reserved. Salesforce.com is a registered trademark of salesforce.com, inc., as are othernames and marks. Other marks appearing herein may be trademarks of their respective owners.
Table of Contents
Chapter 1: Introduction to Mobile Development...................................................................................1Intended Audience....................................................................................................................................................................2About Native, HTML5, and Hybrid Development..................................................................................................................2Enough Talk; Im Ready...........................................................................................................................................................5Development Prerequisites........................................................................................................................................................5
Choosing Between Database.com and Force.com.........................................................................................................6Sign Up for Force.com..................................................................................................................................................6Sign Up for Database.com.............................................................................................................................................6
Mobile SDK Installation...........................................................................................................................................................6Mobile SDK NPM Packages........................................................................................................................................7Mobile SDK GitHub Repository..................................................................................................................................7
Keeping Up With the Mobile SDK..........................................................................................................................................7Whats New in This Release..........................................................................................................................................7
Chapter 2: Native iOS Development.....................................................................................................8iOS Native Quick Start.............................................................................................................................................................9Native iOS Requirements..........................................................................................................................................................9Installing and Uninstalling Salesforce Mobile SDK for iOS.....................................................................................................9Creating a Native iOS App in Xcode......................................................................................................................................10
Running the Xcode Project Template App.................................................................................................................12Developing a Native iOS App.................................................................................................................................................13
About Login and Passcodes.........................................................................................................................................13About Memory Management......................................................................................................................................13Overview of Application Flow.....................................................................................................................................13AppDelegate Class......................................................................................................................................................14About View Controllers..............................................................................................................................................15RootViewController Class...........................................................................................................................................16About Salesforce REST APIs.....................................................................................................................................17
Supported Operations......................................................................................................................................18SFRestAPI Interface........................................................................................................................................20SFRestDelegate Protocol.................................................................................................................................20Creating REST Requests................................................................................................................................21Sending a REST Request................................................................................................................................21SFRestRequest Class.......................................................................................................................................22Using SFRestRequest Methods.......................................................................................................................22SFRestAPI (Blocks) Category.........................................................................................................................23SFRestAPI (QueryBuilder) Category..............................................................................................................24
iOS Sample Applications........................................................................................................................................................26
Chapter 3: Native Android Development............................................................................................27Android Native Quick Start....................................................................................................................................................28
i
Table of Contents
Native Android Requirements.................................................................................................................................................28Installing and Uninstalling Salesforce Mobile SDK for Android............................................................................................28Creating a New Android Project.............................................................................................................................................30
Android Template Application...................................................................................................................................32Setting Up Sample Projects in Eclipse....................................................................................................................................33
Android Project Files...................................................................................................................................................33Developing a Native Android App..........................................................................................................................................33
The create_native Script..............................................................................................................................................34Android Application Structure....................................................................................................................................34Native API Packages...................................................................................................................................................36Overview of Native Classes.........................................................................................................................................37
SalesforceSDKManager Class.........................................................................................................................38KeyInterface Interface......................................................................................................................................39AccountWatcher Class....................................................................................................................................39PasscodeManager Class...................................................................................................................................40Encryptor class.................................................................................................................................................41SalesforceActivity, SalesforceListActivity, and SalesforceExpandableListActivity Classes.............................41UI Classes........................................................................................................................................................41ClientManager and RestClient Classes...........................................................................................................41LoginActivity Class.....................................................................................