Painless Mobile App Development Shawna Wolverton Director, Product Management @shawnawol Tom Gersic Senior Technical Architect @tomgersic
Follow us @forcedotcom
Safe Harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K filed on April 30, 2008 and in other filings with the Securities and Exchange Commission. These documents are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
@forcedotcom / #forcewebinar
Developer Force Group
facebook.com/forcedotcom Developer Force – Force.com Community Follow us @forcedotcom
Agenda App Demo
Database.com Setup Mobile SDK overview Building the app Q&A
Follow us @forcedotcom
Moguls Need Mobile Apps Crump Real Estate Holdings needs
an app to track service requests from their tenants
Follow us @forcedotcom
What we’re going to build today http://www.github.com/tomgersic/CrumpRealEstate
Follow us @forcedotcom
Database.com Built-in Services Accelerate Mobile Development Integrated services, no external app server needed!
•
Integrated user management and security
•
Custom APIs to maximize performance
•
Social data feeds are ideal for mobile interfaces
•
Mobile SDKs simplify client app development
Follow us @forcedotcom
Force.com Workbench SOQL – Query language for Force.com and Database.com Very much like SQL, but has some differences
Follow us @forcedotcom
Salesforce Mobile SDK
Follow us @forcedotcom
Force.com Mobile SDK
Follow us @forcedotcom
Three Options: Which One Is Right For You?
Advanced UI interactions Fastest performance App store distribution
Web developer skills Access to native platform App store distribution
Web developer skills Instant updates Unrestricted distribution
Follow us @forcedotcom
Hybrid Mobile App Development
Follow us @forcedotcom
Force.com Mobile SDK http://developer.force.com/mobile
Follow us @forcedotcom
Force.com Mobile SDK https://github.com/forcedotcom
Follow us @forcedotcom
Follow us @forcedotcom
OAuth An industry standard method of validating user credentials while avoiding password anti-patterns.
Follow us @forcedotcom
Follow us @forcedotcom
OAuth 2.0 Flows Available User-Agent Flow
Username-Password Flow SAML Bearer Assertion Flow Refresh Token Flow JWT Bearer Token Flow Web Server Authentication Flow
Follow us @forcedotcom
OAuth 2.0 Flows Available User-Agent Flow
Username-Password Flow SAML Bearer Assertion Flow Refresh Token Flow JWT Bearer Token Flow Web Server Authentication Flow
Follow us @forcedotcom
OAuth 2.0 User-Agent Flow
Follow us @forcedotcom
OAuth 2.0 User-Agent Flow
Follow us @forcedotcom
OAuth 2.0 Refresh Token Flow
Follow us @forcedotcom
Oauth 2.0 and the Mobile SDK
Follow us @forcedotcom
Code Demo 1: Initial Setup http://www.github.com/tomgersic/CrumpRealEstate
Follow us @forcedotcom
Representational State Transfer (REST) A stateless data transport based on standard HTTP methods for delivering data as JSON or XML
Follow us @forcedotcom
REST API HEAD is used to retrieve resource metadata.
GET is used to retrieve information, such as SOQL Queries using SELECT. POST is used to create a new record. PATCH is used to update or upsert a record. DELETE is used to delete a record. HTTP GET: /services/data/v24.0/query/?q=SELECT+Id,+Name,+Address__c,+Agreed_ Selling_Price__c+FROM+Property__c
Follow us @forcedotcom
REST API Returns a JSON Response /services/data/v24.0/query/?q=select+Id,+Name,+Address__c,+Agreed_ Selling_Price__c+from+Property__c
Follow us @forcedotcom
Code Demo 4 – SOQL Query and View Layer Stuff SFRestAPI singleton
SFRestDelegate UITableViewDataSource UITableViewDelegate
Follow us @forcedotcom
Salesforce.com Mobile SDK SmartStore SQLite ORM wrapper for Native and Hybrid apps built on the SFDC Mobile SDK NoSQL style JSON-based document store
Follow us @forcedotcom
SmartStore Stack
Follow us @forcedotcom
Smartstore Security Only cross-platform NoSQL mobile database technology on the market that comes with encryption built right in. And if you’re doing a hybrid (Phonegap) app…
Follow us @forcedotcom
WebSQL
http://caniuse.com/#search=websql Follow us @forcedotcom
IndexedDB
http://caniuse.com/#search=indexeddb
Follow us @forcedotcom
PhoneGap Storage Class
Follow us @forcedotcom
Terminology Soup – is a database table used to store JSON documents with index columns. Soups are held in Stores, which are SQLite database files. This is all Apple Newton terminology – It had no real filesystem, so data was stored in database entries called “soups” – For the interested: • http://en.wikipedia.org/wiki/Soup_(Apple) • http://www.canicula.com/newton/prog/soups.htm
Follow us @forcedotcom
Step 1 – Register a Soup - (BOOL)registerSoup:(NSString*)soupName withIndexSpecs:(NSArray*)indexSpecs
soupName is whatever you want it to be. Indexes are defined as arrays of objects, and are needed if you want to search or sort by that field.
Follow us @forcedotcom
Step 2 – Upsert Soup Record - (NSArray*)upsertEntries:(NSArray*)entries toSoup:(NSString*)soupName withExternalIdPath:(NSString *)externalIdPath error:(NSError **)error
entries is an array of records to upsert soupName identifies the soup you registered earlier externalIdPath is used by upsert to determine insert/update
NSError error handling
Follow us @forcedotcom
Code Demo 5 – SmartStore Register and Upsert Create a Store
Define some indexes Register a Soup using those indexes Upsert DBDC response data into the Soup
Follow us @forcedotcom
Querying the Soup – Query Specs Three types of query spec: – kQuerySpecTypeExact • kQuerySpecParamMatchKey
– kQuerySpecTypeRange • kQuerySpecParamBeginKey • kQuerySpecParamEndKey
– kQuerySpecTypeLike • kQuerySpecParamLikeKey
Parameters: – kQuerySpecParamOrder
– kQuerySpecParamIndexPath – kQuerySpecParamPageSize Follow us @forcedotcom
Code Demo 6 – Querying the Soup - (SFSoupCursor *)querySoup:(NSString*)soupName withQuerySpec:(NSDictionary *)spec
Soup Name Query Spec reference
Follow us @forcedotcom
Resources Mobile SDK and Database.com Resources – Salesforce.com Mobile SDK http://developer.force.com/mobile – iOS Salesforce Mobile SDK on Github https://github.com/forcedotcom/SalesforceMobileSDK-iOS – Free Database.com Developer Instance http://database.com/ – Crump Real Estate Source Code https://github.com/tomgersic/CrumpRealEstate
Follow us @forcedotcom
http://bit.ly/mobiledev-mw Follow us @forcedotcom
Q&A Please complete our survey
http://bit.ly/ mobileappsurvey
Follow us @forcedotcom