SlideShare a Scribd company logo
1 of 42
Download to read offline
Developing Offline-Capable Apps
with the Salesforce Mobile SDK and
SmartStore
Developer Track
Tom Gersic, Model Metrics / salesforce.com
Director, Technical Solutions
@tomgersic
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.
All About Model Metrics

                Now a salesforce.com Company
                10 year track record - 2,000+ cloud engagements
                Passionate & innovative World-class skills -
                 CRM, Force.com, Heroku, Radian6, Rypple, iOS
                 and Android
                In-house design studio – ModelFX
                Mobile experts - iPhone, iPad and Android
Agenda
 • What we are going to build today
 • Salesforce Mobile SDK Overview
 • SmartStore Terminology and Demo
 • SmartStore Behind the Scenes
 • Building the app
What We’re Building Today, and Why
      http://www.github.com/tomgersic/HazyPassword
Offline Access
Offline Queuing
Database.com Backend
Salesforce Mobile SDK
Force.com Mobile SDK
Three Options: Which One Is Right For You?


       Advanced UI interactions   Web developer skills
       Fastest performance        Access to native platform
       App store distribution     App store distribution




                                  Web developer skills
                                  Instant updates
                                  Unrestricted distribution
Hybrid Mobile App Development
Force.com Mobile SDK
             http://developer.force.com/mobile
Force.com Mobile SDK
               https://github.com/forcedotcom
OAuth
An industry standard method of validating user credentials
while avoiding password anti-patterns.
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
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
OAuth 2.0 User-Agent Flow
OAuth 2.0 User-Agent Flow
OAuth 2.0 Refresh Token Flow
Oauth 2.0 and the Mobile SDK
Representational State Transfer (REST)
A stateless data transport based on standard HTTP
methods for delivering data as JSON or XML
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.
REST API Returns a JSON Response
/services/data/v24.0/query/?q=SELECT Id, Name, Username__c, Password__c,
URL__c FROM Password__c
                              http://bit.ly/sfworkbench
Salesforce.com Mobile SDK SmartStore
 SQLite ORM wrapper for Native and Hybrid apps built on the
 salesforce.com Mobile SDK
 NoSQL style JSON-based document store
SmartStore Stack
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…
WebSQL




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




            http://caniuse.com/#search=indexeddb
PhoneGap Storage Class
Native Database Technology Encryption

 • Encrypt your data yourself using PIN / Passcode
 • CoreData/SQLCipher
   NSIncrementalStore
   Good Dynamics
 • FMDB/SQLCipher
   Salesforce Smartstore
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
Some things you can do with your soup…
 • Register a Soup with an IndexSpec
 • Query a Soup using a QuerySpec
 • Upsert Data to a Soup
 • Delete Data from a Soup
 • Remove a Soup
IndexSpec

 • JSON Object
 • Fields to index
 • “string” or “integer”
 [
 {"path":"Id","type":"string"},
 {"path":"Name","type":"string"}
 ]
QuerySpec

buildAllQuerySpec(path,order,pageSize)
    Query all records from the object in the given sort order (or null order)
buildExactQuerySpec(path,matchKey,pageSize)
     Search for records with index path values matching the key.
buildRangeQuerySpec(path,beginKey,endKey,pageSize)
     Return all records with an index path value between the two range values
buildLikeQuerySpec(path,likeKey,order,pageSize)
     Basically “select * from [table] LIKE ‘%[likeKey]%’”
SmartStore Demo
 Follow along with https://github.com/tomgersic/SmartStoreDemo
SmartStore Behind the Scenes
Code Walkthrough
 http://www.github.com/tomgersic/HazyPassword
Tom Gersic
Director, Technical Solutions – Mobile
             @tomgersic
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore

More Related Content

What's hot

Building JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 PlatformBuilding JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 Platform
Salesforce Developers
 
Build Amazing Website without coding using Salesforce SiteForce
Build Amazing Website without coding using Salesforce SiteForceBuild Amazing Website without coding using Salesforce SiteForce
Build Amazing Website without coding using Salesforce SiteForce
vraopolisetti
 

What's hot (20)

Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Build, Manage, and Deploy Mobile Apps Faster with App Cloud MobileBuild, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
Build, Manage, and Deploy Mobile Apps Faster with App Cloud Mobile
 
Build Consumer-Facing Apps with Heroku Connect
Build Consumer-Facing Apps with Heroku ConnectBuild Consumer-Facing Apps with Heroku Connect
Build Consumer-Facing Apps with Heroku Connect
 
Reinvent your App Dev Lifecycle with Continuous Delivery on Heroku
Reinvent your App Dev Lifecycle with Continuous Delivery on HerokuReinvent your App Dev Lifecycle with Continuous Delivery on Heroku
Reinvent your App Dev Lifecycle with Continuous Delivery on Heroku
 
Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3Secure Development on the Salesforce Platform - Part 3
Secure Development on the Salesforce Platform - Part 3
 
Migrating Visualforce Pages to Lightning
Migrating Visualforce Pages to LightningMigrating Visualforce Pages to Lightning
Migrating Visualforce Pages to Lightning
 
Take your app offline via SMS
Take your app offline via SMSTake your app offline via SMS
Take your app offline via SMS
 
Intro to the Salesforce Mobile SDK: Building iOS Apps Webinar
Intro to the Salesforce Mobile SDK: Building iOS Apps WebinarIntro to the Salesforce Mobile SDK: Building iOS Apps Webinar
Intro to the Salesforce Mobile SDK: Building iOS Apps Webinar
 
Introduction to the Wave Platform API
Introduction to the Wave Platform APIIntroduction to the Wave Platform API
Introduction to the Wave Platform API
 
Modeling and Querying Data and Relationships in Salesforce
Modeling and Querying Data and Relationships in SalesforceModeling and Querying Data and Relationships in Salesforce
Modeling and Querying Data and Relationships in Salesforce
 
Build your API with Force.com and Heroku
Build your API with Force.com and HerokuBuild your API with Force.com and Heroku
Build your API with Force.com and Heroku
 
Tour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration MethodsTour of Heroku + Salesforce Integration Methods
Tour of Heroku + Salesforce Integration Methods
 
Building a RESTful API on Heroku for Your Force.com App
Building a RESTful API on Heroku for Your Force.com AppBuilding a RESTful API on Heroku for Your Force.com App
Building a RESTful API on Heroku for Your Force.com App
 
Building JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 PlatformBuilding JavaScript Applications on the Salesforce1 Platform
Building JavaScript Applications on the Salesforce1 Platform
 
Understanding Native, Hybrid, and Web Mobile Architectures
Understanding Native, Hybrid, and Web Mobile ArchitecturesUnderstanding Native, Hybrid, and Web Mobile Architectures
Understanding Native, Hybrid, and Web Mobile Architectures
 
Salesforce Mobile architecture introduction
Salesforce Mobile architecture introductionSalesforce Mobile architecture introduction
Salesforce Mobile architecture introduction
 
Build Amazing Website without coding using Salesforce SiteForce
Build Amazing Website without coding using Salesforce SiteForceBuild Amazing Website without coding using Salesforce SiteForce
Build Amazing Website without coding using Salesforce SiteForce
 
Integrating Force.com with Heroku
Integrating Force.com with HerokuIntegrating Force.com with Heroku
Integrating Force.com with Heroku
 
Let's Learn About Heroku and How to Integrate with Salesforce
Let's Learn About Heroku and How to Integrate with SalesforceLet's Learn About Heroku and How to Integrate with Salesforce
Let's Learn About Heroku and How to Integrate with Salesforce
 
Developer Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 PlatformDeveloper Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 Platform
 
Web Apps for Salesforce with Heroku Connect
Web Apps for Salesforce with Heroku ConnectWeb Apps for Salesforce with Heroku Connect
Web Apps for Salesforce with Heroku Connect
 

Similar to Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore

Real-time SQL Access for Your Salesforce.com Data
Real-time SQL Access for Your Salesforce.com DataReal-time SQL Access for Your Salesforce.com Data
Real-time SQL Access for Your Salesforce.com Data
Salesforce Developers
 
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.comCreating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Salesforce Developers
 
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.comCreating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Salesforce Developers
 
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.comCreating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Jeff Douglas
 
Developing a Documentation Portal on Heroku
Developing a Documentation Portal on HerokuDeveloping a Documentation Portal on Heroku
Developing a Documentation Portal on Heroku
Salesforce Developers
 
2. 8 things that will make your business love your developers again
2. 8 things that will make your business love your developers again2. 8 things that will make your business love your developers again
2. 8 things that will make your business love your developers again
EuroCloud
 

Similar to Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore (20)

[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum[MBF2] Plate-forme Salesforce par Peter Chittum
[MBF2] Plate-forme Salesforce par Peter Chittum
 
Real-time SQL Access for Your Salesforce.com Data
Real-time SQL Access for Your Salesforce.com DataReal-time SQL Access for Your Salesforce.com Data
Real-time SQL Access for Your Salesforce.com Data
 
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.comCreating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
 
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.comCreating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
 
Using the Google SOAP API
Using the Google SOAP APIUsing the Google SOAP API
Using the Google SOAP API
 
CloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.comCloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.com
 
February 2020 Salesforce API Review
February 2020 Salesforce API ReviewFebruary 2020 Salesforce API Review
February 2020 Salesforce API Review
 
Salesforce platform session 2
 Salesforce platform session 2 Salesforce platform session 2
Salesforce platform session 2
 
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.comCreating HTML5 Applications with jQuery Mobile, Ruby and Database.com
Creating HTML5 Applications with jQuery Mobile, Ruby and Database.com
 
Heroku - developer playground
Heroku - developer playground Heroku - developer playground
Heroku - developer playground
 
Building einstein analytics apps uk-compressed
Building einstein analytics apps   uk-compressedBuilding einstein analytics apps   uk-compressed
Building einstein analytics apps uk-compressed
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
 
Developing a Documentation Portal on Heroku
Developing a Documentation Portal on HerokuDeveloping a Documentation Portal on Heroku
Developing a Documentation Portal on Heroku
 
Introduction to Developing Android Apps With the Salesforce Mobile SDK
Introduction to Developing Android Apps With the Salesforce Mobile SDKIntroduction to Developing Android Apps With the Salesforce Mobile SDK
Introduction to Developing Android Apps With the Salesforce Mobile SDK
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
 
Salesforce Campus Tour - Declarative
Salesforce Campus Tour - DeclarativeSalesforce Campus Tour - Declarative
Salesforce Campus Tour - Declarative
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
2. 8 things that will make your business love your developers again
2. 8 things that will make your business love your developers again2. 8 things that will make your business love your developers again
2. 8 things that will make your business love your developers again
 
Salesforce Campus Tour - Developer Intro
Salesforce Campus Tour - Developer IntroSalesforce Campus Tour - Developer Intro
Salesforce Campus Tour - Developer Intro
 
Igor Androsov on Mobilizing Salesforce Data with 12 Factor App on Heroku
Igor Androsov on Mobilizing Salesforce Data with 12 Factor App on HerokuIgor Androsov on Mobilizing Salesforce Data with 12 Factor App on Heroku
Igor Androsov on Mobilizing Salesforce Data with 12 Factor App on Heroku
 

More from Salesforce Developers

More from Salesforce Developers (20)

Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce DevelopersSample Gallery: Reference Code and Best Practices for Salesforce Developers
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
 
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component PerformanceMaximizing Salesforce Lightning Experience and Lightning Component Performance
Maximizing Salesforce Lightning Experience and Lightning Component Performance
 
Local development with Open Source Base Components
Local development with Open Source Base ComponentsLocal development with Open Source Base Components
Local development with Open Source Base Components
 
TrailheaDX India : Developer Highlights
TrailheaDX India : Developer HighlightsTrailheaDX India : Developer Highlights
TrailheaDX India : Developer Highlights
 
Why developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX IndiaWhy developers shouldn’t miss TrailheaDX India
Why developers shouldn’t miss TrailheaDX India
 
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local DevelopmentCodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Build Lightning Web Components faster with Local Development
 
CodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web ComponentsCodeLive: Converting Aura Components to Lightning Web Components
CodeLive: Converting Aura Components to Lightning Web Components
 
Enterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web ComponentsEnterprise-grade UI with open source Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
 
Live coding with LWC
Live coding with LWCLive coding with LWC
Live coding with LWC
 
Lightning web components - Episode 4 : Security and Testing
Lightning web components  - Episode 4 : Security and TestingLightning web components  - Episode 4 : Security and Testing
Lightning web components - Episode 4 : Security and Testing
 
LWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura InteroperabilityLWC Episode 3- Component Communication and Aura Interoperability
LWC Episode 3- Component Communication and Aura Interoperability
 
Lightning web components episode 2- work with salesforce data
Lightning web components   episode 2- work with salesforce dataLightning web components   episode 2- work with salesforce data
Lightning web components episode 2- work with salesforce data
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Migrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCPMigrating CPQ to Advanced Calculator and JSQCP
Migrating CPQ to Advanced Calculator and JSQCP
 
Scale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in SalesforceScale with Large Data Volumes and Big Objects in Salesforce
Scale with Large Data Volumes and Big Objects in Salesforce
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Modern Development with Salesforce DX
Modern Development with Salesforce DXModern Development with Salesforce DX
Modern Development with Salesforce DX
 
Get Into Lightning Flow Development
Get Into Lightning Flow DevelopmentGet Into Lightning Flow Development
Get Into Lightning Flow Development
 
Integrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS ConnectIntegrate CMS Content Into Lightning Communities with CMS Connect
Integrate CMS Content Into Lightning Communities with CMS Connect
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 

Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore

  • 1. Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore Developer Track Tom Gersic, Model Metrics / salesforce.com Director, Technical Solutions @tomgersic
  • 2. 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.
  • 3. All About Model Metrics  Now a salesforce.com Company  10 year track record - 2,000+ cloud engagements  Passionate & innovative World-class skills - CRM, Force.com, Heroku, Radian6, Rypple, iOS and Android  In-house design studio – ModelFX  Mobile experts - iPhone, iPad and Android
  • 4. Agenda • What we are going to build today • Salesforce Mobile SDK Overview • SmartStore Terminology and Demo • SmartStore Behind the Scenes • Building the app
  • 5. What We’re Building Today, and Why http://www.github.com/tomgersic/HazyPassword
  • 11. Three Options: Which One Is Right For You? Advanced UI interactions Web developer skills Fastest performance Access to native platform App store distribution App store distribution Web developer skills Instant updates Unrestricted distribution
  • 12. Hybrid Mobile App Development
  • 13. Force.com Mobile SDK http://developer.force.com/mobile
  • 14. Force.com Mobile SDK https://github.com/forcedotcom
  • 15.
  • 16. OAuth An industry standard method of validating user credentials while avoiding password anti-patterns.
  • 17.
  • 18. 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
  • 19. 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
  • 22. OAuth 2.0 Refresh Token Flow
  • 23. Oauth 2.0 and the Mobile SDK
  • 24. Representational State Transfer (REST) A stateless data transport based on standard HTTP methods for delivering data as JSON or XML
  • 25. 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.
  • 26. REST API Returns a JSON Response /services/data/v24.0/query/?q=SELECT Id, Name, Username__c, Password__c, URL__c FROM Password__c http://bit.ly/sfworkbench
  • 27. Salesforce.com Mobile SDK SmartStore SQLite ORM wrapper for Native and Hybrid apps built on the salesforce.com Mobile SDK NoSQL style JSON-based document store
  • 29. 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…
  • 30. WebSQL http://caniuse.com/#search=websql
  • 31. IndexedDB http://caniuse.com/#search=indexeddb
  • 33. Native Database Technology Encryption • Encrypt your data yourself using PIN / Passcode • CoreData/SQLCipher  NSIncrementalStore  Good Dynamics • FMDB/SQLCipher  Salesforce Smartstore
  • 34. 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
  • 35. Some things you can do with your soup… • Register a Soup with an IndexSpec • Query a Soup using a QuerySpec • Upsert Data to a Soup • Delete Data from a Soup • Remove a Soup
  • 36. IndexSpec • JSON Object • Fields to index • “string” or “integer” [ {"path":"Id","type":"string"}, {"path":"Name","type":"string"} ]
  • 37. QuerySpec buildAllQuerySpec(path,order,pageSize) Query all records from the object in the given sort order (or null order) buildExactQuerySpec(path,matchKey,pageSize) Search for records with index path values matching the key. buildRangeQuerySpec(path,beginKey,endKey,pageSize) Return all records with an index path value between the two range values buildLikeQuerySpec(path,likeKey,order,pageSize) Basically “select * from [table] LIKE ‘%[likeKey]%’”
  • 38. SmartStore Demo Follow along with https://github.com/tomgersic/SmartStoreDemo
  • 41. Tom Gersic Director, Technical Solutions – Mobile @tomgersic