It is understandable that enterprise users increasingly expect mobile apps to continue working even when an internet or data connection is not available. The capability is extremely vital for mobile users when they are traveling or working in remote areas or in facilities with limited to no online connectivity. As anyone who has used a mobile application knows, there is nothing more frustrating than having your app freeze because your data connection dropped.

 

Users of any App on Salesforce’s App Cloud are confronted with this problem as they require a live connection. This is where the Salesforce Mobile SDK can provide an alternative experience. The Salesforce Mobile SDK offers the ability to develop native iOS and Android applications work even while offline. To enable that experience, the SDK includes the following key components:

 

SmartStore Encrypted Database

 

Mobile databases are useful for building highly responsive apps that also work in any network condition. SmartStore provides an easy way to store and retrieve data locally while supporting a flexible data model. It also uses AES-256 encryption to ensure that your data is always protected at rest. The Smart store provides a secure means for SalesforceMobileSDK Container-based applications to store objects in a persistent and searchable manner. Similar in some ways to CouchDB, SmartStore stores documents as JSON values and allows for indexing and searching on those values.

 

• SmartSync Data Synchronization

 

Salesforce’s Mobile SDK has a storage and synchronization feature called SmartSync that allows users to store data in an on-device database while offline, and automatically syncs with Salesforce data in the cloud when the user comes back online. This allows users to accomplish tasks like updating customer records, adding new leads or entering new orders into their mobile application even with no Internet connectivity. With SmartSync, developers can focus on the UI and business logic of their application while leaving the complex synchronization logic to Mobile SDK. SmartSync is built on the popular backbone.js open source library & uses SmartStore as its default cache. During offline upload, SmartSync gives users highly granular control over the synchronization process. This includes resolving conflicts with data on the Server.

 

• Enterprise Identity & Security

 

Mobile SDK includes a complete implementation of Salesforce Connected App Policy so that all users can access their data securely and easily. It supports OAuth 2.0 and SAML authentication flows to ensure the highest level of security for any user accessing Salesforce from their mobile device.

 

In addition to developing a native mobile app using the SDK, there are a few other options for developing mobile offline capabilities with Salesforce. Each comes with its own limitations and/or constraints, which are important to keep in mind when considering the options:

 

1. Salesforce1: Salesforce’s pre-built app, available on iOS and Android. Salesforce1 can only view recently viewed data cached on a device, and is designed to enhance employee-focused applications by making Salesforce available on multiple mobile platforms and devices. The Salesforce1 app leverage standard lightning components and developing pages in the app does not require any mobile development expertise. Salesforce1 is available for all Salesforce editions; however it is not enabled to create, update or delete records.

 

2. HTML5 apps use standard web technologies—typically HTML5, JavaScript, and CSS—to deliver apps through a mobile web browser. This “write once, run anywhere” approach to mobile development creates cross-platform mobile applications that work on multiple devices. Broadest possible reach across different device platforms but a multi-device strategy is required at the coding level. User experience is best when online. Offline capabilities exist, however, requires leveraging a collection of 3rd party tools including SQLLite, Web Application Cache, and Jave Script Remoting. It’s worth noting that the free version of SQLLite is not encrypted, but an encrypted version is available for a nominal cost.

 

3. Hybrid apps combine the ease of HTML5 web app development with the power of the native platform by wrapping a web app inside the Salesforce container. This combined approach produces an application that can leverage the device’s native capabilities and be delivered through the app store. This option uses the Mobile SDK as well. It’s also important to know that use of Force.com will be required if you choose to develop a Hybrid application.

 

Secure, Offline, Cross-Platform apps with Salesforce Mobile SDK

 

The Salesforce mobile SDK platform enables developers to build fully customized mobile apps that extend well beyond Salesforce’s traditional customer relationship management (CRM) capabilities. The data storage and sync capability in Mobile SDK are fully customizable, so developers and Independent Software Vendors (ISV) can use it to enable an offline capability in any customer-facing mobile application that they might be developing.
Salesforce’s Mobile SDK allows developers to build native applications that are specific to the iOS and Android mobile platforms. It also supports HTML5 web apps and hybrid applications provide alternative options that extend beyond iOS and Android. In all cases, the best results come when developers fully leverage the APIs and core functionalities to build mobile apps that create amazing user experiences, improve productivity and grow a company’s revenues.

 

Is the Salesforce Mobile SDK the right option for you or should you explore others?

The ability to enable offline or disconnected functionality for Salesforce on a mobile platform is a major reason why should you consider using the Salesforce Mobile SDK. The Salesforce mobile SDK can meet the needs for most customer’s requirements, with the HTML5 and Hybrid options filling in very specific use cases. For a deeper conversation about taking Salesforce Mobile offline using any of the options covered in this blog – feel free to reach out to us.

Ahmed
Ahmed
Director - Salesforce