painless mobile app development webinar

43
Follow us @forcedotcom Painless Mobile App Development Shawna Wolverton Director, Product Management @shawnawol Tom Gersic Senior Technical Architect @tomgersic

Upload: salesforce-developers

Post on 10-May-2015

1.916 views

Category:

Technology


1 download

DESCRIPTION

Gartner predicts that by 2015, mobile app projects will outnumber PC app projects 4-to-1. Learn how to quickly build and efficiently maintain native mobile apps that scale on-demand by powering them with cloud technology. In this webinar, you'll learn how to: :: Create a cloud database for your app, one that's automatically scalable and configured for disaster recovery, all in a matter of minutes without ever leaving your browser :: Build a native mobile app that leverages the database's open standards-based APIs for authentication and data persistence :: Code and use a custom REST API for your app to encapsulate unique business logic and improve the efficiency of your app's performance :: Securely store data offline to support situations when the app cannot access the cloud database

TRANSCRIPT

Page 1: Painless Mobile App Development Webinar

Follow us @forcedotcom

Painless Mobile App

Development

Shawna Wolverton

Director, Product Management

@shawnawol

Tom Gersic

Senior Technical Architect

@tomgersic

Page 2: Painless Mobile App Development Webinar

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.

Safe Harbor

Page 3: Painless Mobile App Development Webinar

Follow us @forcedotcom

@forcedotcom / #forcewebinar

Developer Force Group

facebook.com/forcedotcom

Developer Force – Force.com

Community

Page 4: Painless Mobile App Development Webinar

Follow us @forcedotcom

Agenda

App Demo

Database.com Setup

Mobile SDK overview

Building the app

Q&A

Page 5: Painless Mobile App Development Webinar

Follow us @forcedotcom

Moguls Need Mobile Apps

Crump Real Estate Holdings needs

an app to track service requests from

their tenants

Page 6: Painless Mobile App Development Webinar

Follow us @forcedotcom

What we’re going to build today

http://www.github.com/tomgersic/CrumpRealEstate

Page 7: Painless Mobile App Development Webinar

Follow us @forcedotcom

Database.com

Built-in Services Accelerate Mobile Development

Integrated user management

and security

Custom APIs to maximize

performance

Social data feeds are ideal for

mobile interfaces

Mobile SDKs simplify client

app development

Integrated services, no external app server needed!

Page 8: Painless Mobile App Development Webinar

Follow us @forcedotcom

Force.com Workbench

SOQL – Query language for Force.com and

Database.com

Very much like SQL, but has some differences

Page 9: Painless Mobile App Development Webinar

Follow us @forcedotcom

Salesforce Mobile SDK

Page 10: Painless Mobile App Development Webinar

Follow us @forcedotcom

Force.com Mobile SDK

Page 11: Painless Mobile App Development Webinar

Follow us @forcedotcom

Three Options: Which One Is Right For You?

Web developer skills

Access to native platform

App store distribution

Advanced UI interactions

Fastest performance

App store distribution

Web developer skills

Instant updates

Unrestricted distribution

Page 12: Painless Mobile App Development Webinar

Follow us @forcedotcom

Hybrid Mobile App Development

Page 13: Painless Mobile App Development Webinar

Follow us @forcedotcom

Force.com Mobile SDK

http://developer.force.com/mobile

Page 14: Painless Mobile App Development Webinar

Follow us @forcedotcom

Force.com Mobile SDK

https://github.com/forcedotcom

Page 15: Painless Mobile App Development Webinar

Follow us @forcedotcom

Page 16: Painless Mobile App Development Webinar

Follow us @forcedotcom

OAuth

An industry standard method of validating user

credentials while avoiding password anti-patterns.

Page 17: Painless Mobile App Development Webinar

Follow us @forcedotcom

Page 18: Painless Mobile App Development Webinar

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

Page 19: Painless Mobile App Development Webinar

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

Page 20: Painless Mobile App Development Webinar

Follow us @forcedotcom

OAuth 2.0 User-Agent Flow

Page 21: Painless Mobile App Development Webinar

Follow us @forcedotcom

OAuth 2.0 User-Agent Flow

Page 22: Painless Mobile App Development Webinar

Follow us @forcedotcom

OAuth 2.0 Refresh Token Flow

Page 23: Painless Mobile App Development Webinar

Follow us @forcedotcom

Oauth 2.0 and the Mobile SDK

Page 24: Painless Mobile App Development Webinar

Follow us @forcedotcom

Code Demo 1: Initial Setup

http://www.github.com/tomgersic/CrumpRealEstate

Page 25: Painless Mobile App Development Webinar

Follow us @forcedotcom

Representational State Transfer (REST) A stateless data transport based on standard HTTP

methods for delivering data as JSON or XML

Page 26: Painless Mobile App Development Webinar

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

Page 27: Painless Mobile App Development Webinar

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

Page 28: Painless Mobile App Development Webinar

Follow us @forcedotcom

Code Demo 4 – SOQL Query and View Layer Stuff

SFRestAPI singleton

SFRestDelegate

UITableViewDataSource

UITableViewDelegate

Page 29: Painless Mobile App Development Webinar

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

Page 30: Painless Mobile App Development Webinar

Follow us @forcedotcom

SmartStore Stack

Page 31: Painless Mobile App Development Webinar

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…

Page 32: Painless Mobile App Development Webinar

Follow us @forcedotcom

WebSQL

http://caniuse.com/#search=websql

Page 33: Painless Mobile App Development Webinar

Follow us @forcedotcom

IndexedDB

http://caniuse.com/#search=indexeddb

Page 34: Painless Mobile App Development Webinar

Follow us @forcedotcom

PhoneGap Storage Class

Page 35: Painless Mobile App Development Webinar

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

Page 36: Painless Mobile App Development Webinar

Follow us @forcedotcom

Step 1 – Register a Soup

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.

- (BOOL)registerSoup:(NSString*)soupName

withIndexSpecs:(NSArray*)indexSpecs

Page 37: Painless Mobile App Development Webinar

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

Page 38: Painless Mobile App Development Webinar

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

Page 39: Painless Mobile App Development Webinar

Follow us @forcedotcom

Querying the Soup – Query Specs

Three types of query spec:

– kQuerySpecTypeExact

• kQuerySpecParamMatchKey

– kQuerySpecTypeRange

• kQuerySpecParamBeginKey

• kQuerySpecParamEndKey

– kQuerySpecTypeLike

• kQuerySpecParamLikeKey

Parameters:

– kQuerySpecParamOrder

– kQuerySpecParamIndexPath

– kQuerySpecParamPageSize

Page 40: Painless Mobile App Development Webinar

Follow us @forcedotcom

Code Demo 6 – Querying the Soup

Soup Name

Query Spec reference

- (SFSoupCursor *)querySoup:(NSString*)soupName

withQuerySpec:(NSDictionary *)spec

Page 41: Painless Mobile App Development Webinar

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

Page 43: Painless Mobile App Development Webinar

Follow us @forcedotcom

Q&A

Please complete our survey

http://bit.ly/

mobileappsurvey