SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
Introduction to the
Salesforce Mobile SDK for Android

Joshua Birk, salesforce.com, Developer Evangelist
@joshbirk

Wolfgang Mathurin, salesforce.com, Software Engineering PMTS
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.
Device Growth Is Exploding, Driven By Consumers




    Source: Gartner Research; Smartphone, Tablet, and PC Forecast, December 2010.
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
Mobile SDK: Accelerate App Development
Tools for building native, hybrid, and HTML5 apps on iOS and Android

       OAuth2
       Secure authentication and refresh token
       management

       API Wrappers
       Interact with Salesforce REST APIs with
       popular mobile platform languages

       App Container
       Embed HTML5 apps inside a container to
       access powerful native device functionality

       Secure Offline Storage
       Store business data on a device with
       enterprise-class encryption


       Push Notifications
       Dispatch real-time alerts directly to mobile
       devices
Mobile Application
Building Blocks
OAuth
An industry standard method of validating user credentials
while avoiding password anti-patterns.
OAuth2 Flow
                   Sends App Credentials


                             User logs in
                         Token sent to Callback


     Remote                                       Force.com
    Application   Confirms token                   Platform


                           Send access token


                    Maintain session with
                       refresh token
REST Explorer
Representational State Transfer (REST)
A stateless data transport based on standard HTTP
methods for delivering as JSON or XML
5 Minute Android
Application
Step 0: Setup Dev Environment

Required tools
   Git [distributed version control system]
   Ant [java based software build system]
   Eclipse [integrated development environment]
   Android SDK
   ADT Plugin [Android Plugin for Eclipse]
Step 1: Install Salesforce Mobile SDK


Clone the repo
   $ git clone
   https://github.com/forcedotcom/Salesfor
   ceMobileSDK-Android.git
Run install script
   $ ./install.sh
Step 2: Create New Application
• Run create_native ant target
  $ ant create_native -Dapp.name=MyFirstNative -
  Dtarget.dir=./firstnative -Dpackage.name=com.acme.firstnative

Build and deploy new application
  $   cd native/SalesforceSDK
  $   android update project –p .
  $   cd ./firstnative
  $   android update project –p .
  $   ant clean debug
  $   ant installd
In Just Five Minutes…

We have created a new application that leverages the Salesforce
Mobile SDK for Android.
Exploring the code
Key files

Import the project in Eclipse, have a look at:
AndroidManifest.xml
res/values/rest.xml
MainActivity.java
Login/logout

To talk to the Salesforce server you need a RestClient:
   clientManager.getRestClient(…)
This call will automatically kick off the login flow if needed.
When you make request to the server using the RestClient,
 your access token is automatically refreshed whenever it is
 expired.
To log out simply call:
   ForceApp..APP.logout(…)
REST calls

REST API (com.salesforce.androidsdk.rest.RestRequest)
      getRequestForQuery
      getRequestForSearch
      getRequestForCreate
      getRequestForDelete
      getRequestForUpsert
      getRequestForUpdate
      getRequestForDescribe
Let’s add Search
Modify User Interface
Edit main.xml
      <EditText android:id="@+id/search_text"
      android:layout_height="wrap_content" android:layout_width="200dp"
      android:hint="@string/search_hint" android:inputType="text"/>
      <Button android:id="@+id/run_search"
      android:layout_height="wrap_content"
      android:layout_width="wrap_content"
      android:text="@string/search_button"
      android:onClick="onSearchContacts"/>


Edit strings.xml
     <string name="search_hint">Search contacts</string>
     <string name="search_button">Search</string>
Hookup Server Call

Edit MainActivity.java
   public void onSearchContacts(View v) {
          TextView textView = (TextView) findViewById(R.id.search_text);
          String searchText = textView.getText().toString();
           String soql = "SELECT Name FROM Contact WHERE Name LIKE
   '%" + searchText + "%'";
          sendRequest(soql);
     }
In Just A Few Minutes…

We have modified our application to do contact search…
Speaker Name      Speaker Name      Speaker Name      Speaker Name
 Speaker Title,    Speaker Title,    Speaker Title,    Speaker Title,
 @twittername      @twittername      @twittername      @twittername
Introduction to the Salesforce Mobile SDK for Android

Más contenido relacionado

La actualidad más candente

La actualidad más candente (10)

Lingual orthodontics /certified fixed orthodontic courses by Indian dental ac...
Lingual orthodontics /certified fixed orthodontic courses by Indian dental ac...Lingual orthodontics /certified fixed orthodontic courses by Indian dental ac...
Lingual orthodontics /certified fixed orthodontic courses by Indian dental ac...
 
Oracle Database Management - Backup/Recovery
Oracle Database Management - Backup/RecoveryOracle Database Management - Backup/Recovery
Oracle Database Management - Backup/Recovery
 
Oracle e-business suite R12 step by step Installation
Oracle e-business suite R12 step by step InstallationOracle e-business suite R12 step by step Installation
Oracle e-business suite R12 step by step Installation
 
Hl7 Standards
Hl7 StandardsHl7 Standards
Hl7 Standards
 
FHIR Profiles
FHIR ProfilesFHIR Profiles
FHIR Profiles
 
Alignment of blocked out maxillary lateral incisors-jcojuly2000
Alignment of blocked out maxillary lateral incisors-jcojuly2000Alignment of blocked out maxillary lateral incisors-jcojuly2000
Alignment of blocked out maxillary lateral incisors-jcojuly2000
 
Dragon de mar
Dragon de marDragon de mar
Dragon de mar
 
FHIR tutorial - Afternoon
FHIR tutorial - AfternoonFHIR tutorial - Afternoon
FHIR tutorial - Afternoon
 
Leveling & aligning(text) /certified fixed orthodontic courses by Indian dent...
Leveling & aligning(text) /certified fixed orthodontic courses by Indian dent...Leveling & aligning(text) /certified fixed orthodontic courses by Indian dent...
Leveling & aligning(text) /certified fixed orthodontic courses by Indian dent...
 
Hl7 Standards (September 15, 2016)
Hl7 Standards (September 15, 2016)Hl7 Standards (September 15, 2016)
Hl7 Standards (September 15, 2016)
 

Destacado

How to create a native android app with Salesforce mobile sdk2.0
How to create a native android app with Salesforce mobile sdk2.0How to create a native android app with Salesforce mobile sdk2.0
How to create a native android app with Salesforce mobile sdk2.0
Akihiro Iwaya
 

Destacado (10)

Enterprise Mobile Methodology with Salesforce + MobileIron
Enterprise Mobile Methodology with Salesforce + MobileIronEnterprise Mobile Methodology with Salesforce + MobileIron
Enterprise Mobile Methodology with Salesforce + MobileIron
 
How to create a native android app with Salesforce mobile sdk2.0
How to create a native android app with Salesforce mobile sdk2.0How to create a native android app with Salesforce mobile sdk2.0
How to create a native android app with Salesforce mobile sdk2.0
 
Whitepaper SFA
Whitepaper SFAWhitepaper SFA
Whitepaper SFA
 
See Androids Fighting: Connect Salesforce with Your Android Wear Watch
See Androids Fighting: Connect Salesforce with Your Android Wear WatchSee Androids Fighting: Connect Salesforce with Your Android Wear Watch
See Androids Fighting: Connect Salesforce with Your Android Wear Watch
 
Sales Force Automation
Sales Force AutomationSales Force Automation
Sales Force Automation
 
A research on- Sales force Project- documentation
A research on- Sales force Project- documentationA research on- Sales force Project- documentation
A research on- Sales force Project- documentation
 
Restaurant Finder Android Application project Presentation
Restaurant Finder Android Application project PresentationRestaurant Finder Android Application project Presentation
Restaurant Finder Android Application project Presentation
 
Sales Force Automation
Sales Force AutomationSales Force Automation
Sales Force Automation
 
Salesforce crm projects
Salesforce crm projects Salesforce crm projects
Salesforce crm projects
 
Android College Application Project Report
Android College Application Project ReportAndroid College Application Project Report
Android College Application Project Report
 

Similar a Introduction to the Salesforce Mobile SDK for Android

Introduction to the Salesforce.com Mobile SDK for iOS
Introduction to the Salesforce.com Mobile SDK for iOSIntroduction to the Salesforce.com Mobile SDK for iOS
Introduction to the Salesforce.com Mobile SDK for iOS
Salesforce Developers
 
Introduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile DevicesIntroduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile Devices
Salesforce Developers
 
Authentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsAuthentication with OAuth and Connected Apps
Authentication with OAuth and Connected Apps
Salesforce Developers
 
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreDeveloping Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Salesforce Developers
 
Salesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUGSalesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUG
Tom Gersic
 
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
 
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 a Introduction to the Salesforce Mobile SDK for Android (20)

Introduction to the Salesforce.com Mobile SDK for iOS
Introduction to the Salesforce.com Mobile SDK for iOSIntroduction to the Salesforce.com Mobile SDK for iOS
Introduction to the Salesforce.com Mobile SDK for iOS
 
Introduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile DevicesIntroduction to Visualforce for Mobile Devices
Introduction to Visualforce for Mobile Devices
 
Authentication with OAuth and Connected Apps
Authentication with OAuth and Connected AppsAuthentication with OAuth and Connected Apps
Authentication with OAuth and Connected Apps
 
Modev presentation
Modev presentationModev presentation
Modev presentation
 
Salesforce Mobile architecture introduction
Salesforce Mobile architecture introductionSalesforce Mobile architecture introduction
Salesforce Mobile architecture introduction
 
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStoreDeveloping Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
Developing Offline-Capable Apps with the Salesforce Mobile SDK and SmartStore
 
Atl elevate programmatic developer slides
Atl elevate programmatic developer slidesAtl elevate programmatic developer slides
Atl elevate programmatic developer slides
 
[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
 
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
 
Developers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 PlatformDevelopers guide to the Salesforce1 Platform
Developers guide to the Salesforce1 Platform
 
Developer Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 PlatformDeveloper Tour on the Salesforce1 Platform
Developer Tour on the Salesforce1 Platform
 
CloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.comCloudOps evening presentation from Salesforce.com
CloudOps evening presentation from Salesforce.com
 
How Force.com developers do more in less time
How Force.com developers do more in less timeHow Force.com developers do more in less time
How Force.com developers do more in less time
 
Salesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUGSalesforce.com Mobile Dev Week Chicago DUG
Salesforce.com Mobile Dev Week Chicago DUG
 
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
 
Dreamforce 13 developer session: Introduction to Heroku
Dreamforce 13 developer session: Introduction to HerokuDreamforce 13 developer session: Introduction to Heroku
Dreamforce 13 developer session: Introduction to Heroku
 
Introduction to Apex for Developers
Introduction to Apex for DevelopersIntroduction to Apex for Developers
Introduction to Apex for Developers
 
SRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile ServicesSRV421 Deep Dive with AWS Mobile Services
SRV421 Deep Dive with AWS Mobile Services
 
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
 

Más de Salesforce Developers

Más de 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
 
TrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer HighlightsTrailheaDX and Summer '19: Developer Highlights
TrailheaDX and Summer '19: Developer Highlights
 
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 the Salesforce Mobile SDK for Android

  • 1. Introduction to the Salesforce Mobile SDK for Android Joshua Birk, salesforce.com, Developer Evangelist @joshbirk Wolfgang Mathurin, salesforce.com, Software Engineering PMTS
  • 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. Device Growth Is Exploding, Driven By Consumers Source: Gartner Research; Smartphone, Tablet, and PC Forecast, December 2010.
  • 4. 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
  • 5. Mobile SDK: Accelerate App Development Tools for building native, hybrid, and HTML5 apps on iOS and Android OAuth2 Secure authentication and refresh token management API Wrappers Interact with Salesforce REST APIs with popular mobile platform languages App Container Embed HTML5 apps inside a container to access powerful native device functionality Secure Offline Storage Store business data on a device with enterprise-class encryption Push Notifications Dispatch real-time alerts directly to mobile devices
  • 7.
  • 8. OAuth An industry standard method of validating user credentials while avoiding password anti-patterns.
  • 9. OAuth2 Flow Sends App Credentials User logs in Token sent to Callback Remote Force.com Application Confirms token Platform Send access token Maintain session with refresh token
  • 11. Representational State Transfer (REST) A stateless data transport based on standard HTTP methods for delivering as JSON or XML
  • 13. Step 0: Setup Dev Environment Required tools Git [distributed version control system] Ant [java based software build system] Eclipse [integrated development environment] Android SDK ADT Plugin [Android Plugin for Eclipse]
  • 14. Step 1: Install Salesforce Mobile SDK Clone the repo $ git clone https://github.com/forcedotcom/Salesfor ceMobileSDK-Android.git Run install script $ ./install.sh
  • 15. Step 2: Create New Application • Run create_native ant target $ ant create_native -Dapp.name=MyFirstNative - Dtarget.dir=./firstnative -Dpackage.name=com.acme.firstnative Build and deploy new application $ cd native/SalesforceSDK $ android update project –p . $ cd ./firstnative $ android update project –p . $ ant clean debug $ ant installd
  • 16. In Just Five Minutes… We have created a new application that leverages the Salesforce Mobile SDK for Android.
  • 18. Key files Import the project in Eclipse, have a look at: AndroidManifest.xml res/values/rest.xml MainActivity.java
  • 19. Login/logout To talk to the Salesforce server you need a RestClient: clientManager.getRestClient(…) This call will automatically kick off the login flow if needed. When you make request to the server using the RestClient, your access token is automatically refreshed whenever it is expired. To log out simply call: ForceApp..APP.logout(…)
  • 20. REST calls REST API (com.salesforce.androidsdk.rest.RestRequest)  getRequestForQuery  getRequestForSearch  getRequestForCreate  getRequestForDelete  getRequestForUpsert  getRequestForUpdate  getRequestForDescribe
  • 22. Modify User Interface Edit main.xml <EditText android:id="@+id/search_text" android:layout_height="wrap_content" android:layout_width="200dp" android:hint="@string/search_hint" android:inputType="text"/> <Button android:id="@+id/run_search" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/search_button" android:onClick="onSearchContacts"/> Edit strings.xml <string name="search_hint">Search contacts</string> <string name="search_button">Search</string>
  • 23. Hookup Server Call Edit MainActivity.java public void onSearchContacts(View v) { TextView textView = (TextView) findViewById(R.id.search_text); String searchText = textView.getText().toString(); String soql = "SELECT Name FROM Contact WHERE Name LIKE '%" + searchText + "%'"; sendRequest(soql); }
  • 24. In Just A Few Minutes… We have modified our application to do contact search…
  • 25. Speaker Name Speaker Name Speaker Name Speaker Name Speaker Title, Speaker Title, Speaker Title, Speaker Title, @twittername @twittername @twittername @twittername