Alex Berg

Mobile Apps for Salesforce Made Simple with Mobile SDK

Mobile apps that tie into Salesforce are not new, but creating them is about to become much simpler. In software, simplicity makes everything better: fewer bugs due to fewer oversights, faster development due to removed complexities, and better maintainability due to fast ramp-up for new maintainers. This is all made possible for mobile apps that integrate with Salesforce with the promotion of Salesforce’s Mobile SDK out of beta. And it is deservedly promoted; the end product is clean and very simple. It abstracts away the complexities of communicating remotely with Salesforce, making remotely querying an org’s Salesforce database effortless. On top of that, it supports a variety of different models of mobile apps, namely architectures that are 1) completely native to each mobile OS, 2) HTML5 apps that are completely Visualforce and Apex-based, or 3) a hybrid architecture, where a native app is created that pulls its interface and views from HTML5 pages built in Visualforce and Apex.

Let’s discuss a bit what exactly the Mobile SDK will provide you when you use each of these architectures.

1) Native App

The Salesforce Mobile SDK includes great support for writing completely native apps for iOS and Android. What do you get when you use it for your apps? The first thing that it provides you is a library that wraps database query requests and the results of these queries. Part of the Mobile SDK moving to GA is that the APIs that developers use will not change with future versions of the SDK, which is great. The second thing that it provides is complete authentication management based on the OAuth2 standard - the developer does not have to worry about OAuth token management. The third thing, and the most important, in my opinion, is the included templates that spring-board a developer past the tedium of writing the plumbing for database requests and right into the business-logic, queries, and displaying the data on the mobile device.

What are the pros/cons of choosing this kind of solution?The advantage to using this style of app is that you can access the facilities of the mobile device, such as the camera, gyros, and the address book. You can also place your app in the app markets for each mobile OS, such as iOS’s App Store and Android’s App Market. The disadvantage is that writing a native mobile app can be difficult. iOS requires extensive knowledge of Objective-C and iOS architecture, and writing the same app for Android requires knowledge in Java and Android OS architecture.

2) HTML5 App

The Mobile SDK also include support for writing HTML5 apps that are optimized for viewing on the smaller screens of mobile devices. How does it help you write these HTML5 apps? Rather than new libraries for this style of solution, it provides starter code and plumbing that a developer can copy and customize. This starter code consists mostly of Javascript on a Visualforce page that listens for touch/click events on the page, sends requests to the Apex controller, and formats and places the results into HTML5 tags. This is a great boost for developers that aren’t too familiar with HTML5 and Javascript. These HTML5 apps are hosted on your Salesforce org and viewed through a standard browser, either on a smartphone or tablet computer.

The advantage to using this style of architecture is that you don’t have to write code specific for each device that uses your app; as long as the mobile device has a standards-compliant web browser, it should be able to render your mobile app without any extra work. The disadvantage to this approach is that you can not access device hardware, such as the camera and address book. Also, you can not create user interfaces that look and feel like apps native to the mobile OS.

3) Hybrid App

A third style of architecture that the Mobile SDK supports is a hybrid between completely native and completely HTML5-based. What is a mobile hybrid architecture? It is one that makes a native mobile app that does little more than authenticate the user with Salesforce and act as a web browser by requesting your HTML5 Visualforce page and rendering it in your app. With this approach, the business logic is entirely based in HTML5 and Visualforce, and the native code does little more than place a link to this app on the mobile device in the form of an app. How does the Mobile SDK help you do this? It provides all of the plumbing for you, only requesting a authentication key and the landing web page for the app to load when started.

This advantage to this approach is that the business logic is compatible with all devices and doesn’t have to be recreated for each mobile device. Your can also place your app in the iOS or Android app markets and show your app on the mobile device’s home screen. The disadvantage is that your app will still not be able to use a device’s hardware facilities and integrate with its OS.

Mobile Apps Enable

With the Mobile SDK, you have many options available to you when writing mobile applications, and no matter which one you choose, development will be spring-boarded past the tedious plumbing work. Many businesses will be able to take advantage of this new SDK to improve and streamline the Salesforce interface for their employees for each job role they have. How can you better enable your employees with mobile apps? Maybe with an app that is specialized for your sales team to use that advertises your product offerings in an attractive manner? Maybe with an app for your project-based teams to quickly check the status of their project and tasks assigned to them from their mobile device?

Posted in: Mobile, Salesforce, Software Development, Technical Strategy