Custom Applications

There are many ways to develop custom mobile applications that leverage the Force.com platform. Salesforce has assembled tools and techniques for each of the three distinct approaches to mobile development, listed here:

Image Native applications—Native applications have unrestricted access to all of the features of the mobile device. This power can be used to deliver the best possible user experience, but typically comes with a high development cost, especially if an application must be supported on multiple mobile vendors’ devices.

Image Mobile Web applications—On the opposite end of the spectrum, mobile Web applications run inside the mobile device’s Web browser based on HTML5. They do not have access to the full set of device capabilities, but with this compromise comes advantages in terms of ease of development and distribution.

Image Hybrid applications—Hybrid applications are mobile Web applications deployed inside a native application that serves as a “container.” The most notable benefits are access to native device features and the ability to promote and distribute the application on device-specific marketplaces.

The Salesforce Mobile Software Development Kit (SDK) provides open source technology to aid in the development of all three types of custom mobile applications. Download it from the following location:

Image iOS—https://github.com/forcedotcom/SalesforceMobileSDK-iOS

Image Android—https://github.com/forcedotcom/SalesforceMobileSDK-Android


Note

The Salesforce Mobile SDK page at http://wiki.developerforce.com/page/Mobile_SDK is an excellent starting point for diving deeper into Salesforce’s mobile development technology.


Native Applications

Native applications are purpose-built for each device platform. For example, a native mobile developer targets one or more mobile platforms such as iOS, Android, Windows Phone, and BlackBerry 10. Although there are vendors that promise shortcuts, strictly speaking each platform adds its own jargon, development tools and frameworks, and unique approach to mobile challenges such as user interface paradigm, hardware abstraction, and software deployment.

The advantages of native applications include usability, integration with hardware and native applications (such as those managing calendars and contacts), access to secure offline storage, and built-in application distribution. Disadvantages vary but typically involve the cost and complexity of supporting multiple devices and operating systems.

Salesforce Mobile SDK provides libraries and sample projects for developing native applications for iOS and Android. Specifically, it helps developers in four main areas:

Image Login—The Mobile SDK simplifies the OAuth login process.

Image Offline data caching—SmartStore is a component of the Mobile SDK that enables the secure storage of data for offline access.

Image REST—The Force.com REST API is provided as a set of friendly infrastructure classes.

Image Application creation—The Mobile SDK includes a tool called forceios that generates a sample native application to connect to a Salesforce organization and run a simple query. This can be a good starting point for your development.

Mobile Web Applications

Mobile Web applications rely on the mobile device’s browser to function. Often they are ordinary Web pages designed to adapt their user interfaces from full-size monitors to tiny mobile screens. This usage of standard Web technology to deliver the same application to desktop and mobile users can be a huge time savings over native application development.

Another significant advantage to mobile Web applications is that they are served up from servers, not stored on the mobile device. This means developers can continually improve the application remotely, and users always see the latest version. Native and hybrid applications have a binary component that is downloaded and installed on the device. Although the binary can be updated after it is installed, that is an additional manual step for the user.

Unfortunately, mobile Web applications are rarely able to deliver the same level of user experience as a native application. Due to size and battery constraints, tablets and phones have a subset of the processing power of laptop and desktop computers. Their Web browser cannot render complex pages or execute code as quickly. Additionally, the standard user interface components that the user is familiar with from the mobile device are either Web-based approximations or entirely different, requiring the user to adapt to the new way of representing data and controls.

Salesforce Mobile SDK includes two libraries that are extremely helpful in building mobile Web applications integrated with Force.com, described next:

Image SmartSync—SmartSync exposes Salesforce records as JavaScript objects, with query and CRUD access seamlessly supported. It extends a popular open source framework called Backbone.js to accomplish this.

Image forcetk.jsThis JavaScript library is a wrapper of the Salesforce REST API.

Hybrid Applications

Hybrid applications promise the best of both worlds, combining the flexibility of native with the ease of development of Web. In a hybrid application, some content is shipped in the binary like a normal native application, while some is left out and delivered through Web pages instead. Their distinguishing feature is a “container” that hosts the Web content and grants it access to native resources.

Being a mixture of native and Web, hybrid applications share the pros and cons of both. For example, if your hybrid application relies extensively on Web content, it will suffer the user experience limitations of mobile Web applications. In general, hybrid applications rely on the judgment of the developer to select the best way (native or Web) to implement functionality on a feature-by-feature basis.

This introduces a larger issue of complexity. Although developers have greater flexibility with hybrid applications, building them requires knowledge of both mobile Web and native technology, plus the “container” layer between them. The container in the Salesforce Mobile SDK is called Cordova (formerly PhoneGap).


Note

Due to their significant dependence of technology unrelated to Force.com, hybrid and native applications are outside the scope of this book. Refer to the Salesforce Mobile SDK home page at http://wiki.developerforce.com/page/Mobile_SDK for more information.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.243.4