salesforce mobile devweek 21-28 april: introduction to native & hybrid development with...

23
Introduction to force.com Mobile SDK – Native & Hybrid Development Gaurav Kheterpal, Head – Mobility, Metacube [email protected] @gauravkheterpal

Upload: gaurav-kheterpal

Post on 10-May-2015

792 views

Category:

Technology


0 download

DESCRIPTION

This session was meant to introduce the force.com Mobile SDK to all attendees of the Jaipur Developer User Group. This was a part of the global Salesforce Mobile Dev Week - http://www2.developerforce.com/mobile/developer-week

TRANSCRIPT

Page 1: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Introduction to force.com Mobile SDK – Native & Hybrid Development

Gaurav Kheterpal, Head – Mobility, Metacube [email protected] @gauravkheterpal

Page 2: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

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 product or service availability, 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, new products and services, 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 outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, 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, our limited history reselling non-salesforce.com products, 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-Q for the most recent fiscal quarter ended July 31, 2012. This documents and others containing important disclosures 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 presentations, 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.

Page 3: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Gaurav Kheterpal Head – Mobility, Metacube

@gauravkheterpal

Page 4: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Agenda §  Quick Poll §  Introduction – Self

§  Why Mobile?

§  Introduction – force.com §  Introduction – Mobile SDK

§  Mobile SDK – iOS

§  Why Hybrid?

§  Hands-On §  Summary/ Q&A

Page 5: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Intro •  Engineering Post Graduate from BITS, Pilani (Not everybody

drops out J) •  Mobile + Web Developer With 13 Years of Industry

Experience (I’m getting old L) •  Started my journey with the ‘Ultimate Killer Mobile App’ (Any

guesses?) •  Speaker at Dreamforce 2012, Droidcon 2011 and 2012 and

several Mobile Monday events •  Keen Interest in Cross-Platform Frameworks such as

Titanium, PhoneGap, Sencha Touch and others

Page 6: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Why Mobile?

Source: Gartner Research; Smartphone, Tablet, and PC Forecast, December 2010.

Page 7: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

We’re Living in the Post-PC Era

iPhone Revenue – Q1 ’12 $24.42 billion

TOTAL Microsoft Revenue – Q2 ’12 $20.89 billion

>

Page 8: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Info Workers Use Many Devices For Work & Personal

52% of information workers use 3 or more devices

60% of these devices are used for both work and personal use

Source: Forrester Blogs: Why Tablets Will Become Our Primary Computing Device, Frank Gillett, April 23, 2012

Page 9: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

force.com Mobile SDK

Page 10: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

force.com Mobile SDK – Getting Started §  Git repos

•  https://github.com/forcedotcom/SalesforceMobileSDK-iOS

•  https://github.com/forcedotcom/SalesforceMobileSDK-Android

§  Tools •  iOS – git, Xcode

•  Android – git, Eclipse

Page 11: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

force.com Mobile SDK (iOS) – Installation

$ git clone https://github.com/forcedotcom/SalesforceMobileSDK -iOS.git

$ cd SalesforceMobileSDK-iOS $ ./install.sh

Page 12: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

force.com Mobile SDK - oAuth

Remote Application

Force.com Platform

Sends App Credentials

User logs in Token sent to Callback

Confirms token

Send access token

Maintain session with refresh token

Page 13: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

force.com Mobile SDK - oAuth

Page 14: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

force.com Mobile SDK - CRUD

Page 15: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Why Hybrid?

•  Write once, run anywhere

•  Reuse existing web development skills

•  Visualforce, HTML5, JavaScript, CSS3 etc.

•  Access native device functionality

•  App Store distribution (unlike web apps)

Page 16: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Why not Hybrid?

•  May not be as fast as native apps

•  Limited support for multi-touch gestures

•  Cannot do advanced graphics like WebGL

Page 17: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

How Does Hybrid Work?

The JavaScript Native ‘Bridge’ = Custom WebView Call JS from native code

Call native code from JS

Page 18: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Hybrid - PhoneGap or Cordova?

•  Cordova is an Apache Open Source project

•  PhoneGap is a distribution of Cordova distributed by Adobe

•  Currently, PhoneGap and Cordova are one and the same

•  Mobile SDK uses Cordova

Page 19: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Hybrid - What Libraries Can You Use?

•  XUI

•  Zepto

•  jQuery

•  Dojo

DOM

•  jQuery Mobile

•  Sencha Touch

•  Dojo Mobile

•  GloveBox

•  Ekiben

© http://www.slideshare.net/davyjones/html5-is-the-future-of-mobile-phonegap-takes-you-there-today

GUI

•  QUnit

•  Jasmine

•  DominatorJS

•  ThumbsJs

•  Mocha

Testing

Any JS/CSS library/framework of your choice

Page 20: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Mobile SDK Integration Opportunities

§  Mobile SDK vs. Other Approaches •  zkSforce

•  REST API

Page 21: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Learning Path

§  Mobile SDK GitHub Repo

§  DFC (http://wiki.developerforce.com)

§  Mobile SDK Workbook §  Force.com Mobile Discussion Boards

Page 22: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK

Gaurav Kheterpal

Head – Mobility, Metacube [email protected]

@gauravkheterpal

Page 23: Salesforce Mobile DevWeek 21-28 April: Introduction to Native & Hybrid Development with force.com Mobile SDK