The mobile industry is evolving rapidly with an increasing number of mobile devices, such as smartphones and tablets. More people are accessing services via mobile devices than ever before. The mobile solution is directly impacting businesses, organizations, and their growing number of customers and partners. Even employees now expect to access services on a mobile device.
This chapter is an introduction to Worklight and where it fits into IBM Mobile Application Platform. At the end of this chapter, the reader will understand the basic components of IBM Worklight and how it contributes to building mobile applications. Currently, there are several approaches for mobile application development, such as the following:
Web development: This approach uses open web client programming modules, such as HTML5 and JavaScript.
Hybrid development: This approach uses the app source code that consists of the web code, executed within a native container that is provided by Worklight and native libraries.
Hybrid mixed: The developer adds arguments to the web code using the native language to create unique features and access native APIs that are available via JavaScript, such as APIs for a camera, an accelerometer, and other functionalities.
Native development: In this approach, the application is developed using native languages or transcoded into a native language via MAP tool's native appearance device capabilities, and performance.
To develop a similar application on a different platform requires a different level of expertise, which is expensive in terms of cost, time, and complexity. The following table outlines the major aspects of the different approaches to development. Reviewing this list can help you choose the approach that is ideal for your particular mobile application.
Native |
Hybrid |
Mobile Web | |
---|---|---|---|
Skills/tools |
|
|
|
Distribution |
App store |
App store |
Internet/online |
Development speed |
Slow |
Moderate |
Fast |
Device accessibility |
Full native device access |
Full native device access |
Partial device access |
Application maintenance |
Difficult |
Moderate |
Easy |
The hybrid development approach is about taking advantage of both native and mobile web development approaches. It benefits from the versatility of web technologies combined with powerful device features and SDK. It is well suited for a range of applications and can still provide good user experience.
The following table highlights the advantages and disadvantages of the hybrid approach:
Advantages of the hybrid approach |
Disadvantages of the hybrid approach |
---|---|
Lower learning curve |
Performance of the application is slightly slower than native approach because of the data access across multiple layers |
Fast to develop and release | |
Easy to port, making it cost effective | |
Access to and support for native device functionality |
When escalating the business perspective to the mobile platform, we need to build an application for web-based responsive mobile apps with rich development environment for better performance and vast access control. IBM Worklight seems to be the most efficient and optimized to handle any kind of interactive and enterprise mobile application. Generally, the hybrid solutions are dependent on less secure or custom security identifiers, but Worklight's built-in security modules provides perfectly improvised frameworks to implement. Besides all of its classified and highly efficient features, it provides a complete studio to implement rich application development. For server-side security and implementation, it provides complete console management and accessibility for every component. It can also be utilized for creating a report and generating a complete view to study application statistics and performance. If you merge all cross-platforms into one, then IBM Worklight will be much trusted and efficient to use for business modernization and management.
IBM Worklight is an extensible mobile application platform that brings together many mobile capabilities into a single product and allows organizations to develop and deliver HTML5, hybrid and native applications, and deliver these applications with mobile middleware, security features, integrated data management, and analytics capabilities.
In 2012, IBM acquired its very first set of mobile development and integration tools called IBM Worklight, which allows organizations to transform their business and deliver mobile solutions to their customers. IBM Worklight provides a truly open approach for developers to build an application and run it across multiple mobile platforms without having to port it for each environment, that is, Apple iOS, Google Android, Blackberry, and Microsoft Windows Phone. IBM Worklight also makes the developer's life easier by using standard technologies such as HTML5 and JavaScript with extensions for popular libraries such as jQuery Mobile, Dojo Toolkit, and Sencha Touch.
IBM Worklight offers an open platform to assist businesses to deliver existing and new mobile applications to multiple devices. According to IBM, "it is an important piece of IBM's strategy" that simplifies end-to-end security and service integration between mobile applications and backend systems. Additionally, it helps clients dramatically reduce mobile application time to market, cost, and complexity. Moreover, IBM Worklight came up with variety of components to efficiently develop, test, connect, run, and manage mobile applications.
The following screenshot summarizes the capabilities, extensive frameworks, and tools within Worklight:

A relative newcomer to this world of cross-platform development, Worklight has dramatically taken its place within the community. IBM Worklight aims to change the way in which mobile developers think about creating rich functionality in their mobile applications. It does this in a very efficient manner, providing a complete platform for development unlike other cross-platform developers who only offer libraries to do the job.
Development in IBM Worklight is similar to web development, where developers and designers can leverage their existing knowledge of Cascading Style Sheet (CSS), Hypertext Markup Language (HTML), and straightforward JavaScript to manipulate pages and their elements directly, making development more rapid. The IDE works in conjunction with the native SDKs while building an app for Android.
The IDE builds and compiles the Android project and exports it within the same IDE. For iPhone, it generates files for an Xcode project.
In this book, we're going to take an in-depth look at what Worklight has to offer for building rich mobile applications. Let's start by finding out what exactly Worklight brings to the mobile development environment.
IBM Worklight is a mobile application platform containing all of the tools needed to develop a mobile application. If we combine IBM Worklight components into a stream, it would be clean to say that hybrid mobile application development is tightly coupled with a baseline.
Each component in Worklight is integrated with the other, for the creation of a rich interface and cost-effective mobile app in fragments, and to control the growing portfolio of an application. IBM Worklight provides high user experience index and full device access with native controls. It is a mobile application development tool that contains all modules, including the mobile application development framework and modules for testing and distribution. There are mainly two development editions:
IBM Worklight Enterprise Edition
IBM Worklight Consumer Edition
IBM Worklight Enterprise and Consumer Editions are identical except for the licensed models. The Consumer Edition is completely licensed per mobile application, whereas the Enterprise Edition contains license per device.
Every specified component provides a bundle of functionalities and support. The following is the lifecycle for mobile application development:
Worklight Studio: IBM Worklight provides a robust, Eclipse-based development environment called Worklight Studio, which allows developers to quickly construct mobile applications for multiple platforms.
Worklight Server: This component is a runtime server that activates or enables secure data transmission through centralized backend connectivity with adapters. It is used for offline encrypted storage, unified push notification, and many other applications.
Worklight Device Runtime: The device runtime provides a rich set of APIs that are accessible across platforms and offer easy access to the services provided by the IBM Worklight Server.
Worklight Console: This is a web-dependent interface for real-time analytics, managing push notification authority, and mobile version management. Worklight Console is a web-based interface and is dedicated to ongoing administration of Worklight Server and its deployed apps, adapters, and push notification services.
Worklight Application Center: This is a cross-platform mobile application store that fulfils specific needs for mobile application development teams.
Each component is discussed in detail in the following sections.
IBM Worklight Studio provides a complete extensible environment with maximum code reusability and device optimization. It contains client-side implementation and web technologies that rely on the Worklight optimization framework. In this component, a user can find third-party library integration with device SDKs. The main purpose of this module is to create a hybrid application that can be used on and is deployable to any mobile platform such as Android, iPhone, Blackberry, and Windows Phone.

The preceding screenshots illustrates the Worklight Studio. It's an Eclipse-based IDE to facilitate the developer with operating and controlling projects in a normal hierarchical structure and to organize the source code for easy access. It is responsible for code maintenance, framework implementation, and rich multiplatform development. It also contains a variety of procedures to achieve device portability.
We will explore the key functionality advantages of Worklight Studio in the following sections.
IBM Worklight Studio provides complete extensibility and compatibility in pure native and web application development. With a very simple wizard, a developer can easily add JavaScript frameworks such as Dojo, jQuery Mobile, and Sencha Touch and IDE provide a WYSIWYG editor for quickly building UIs in a drag-and-drop fashion with the support of UI components.
IBM Worklight provides a hybrid shell for mobile applications that offers all capabilities to web and native technologies. By creating a custom shell, you can add third-party native libraries that include Cordova/PhoneGap plugins and can implement custom security modules and extend features specific to enterprise modernization. The shell could be used as enforcement of corporate guideline specifications for designing and security rules. For example, a shell can be utilized to improve and amend default mobile applications or to control native features.
Worklight Studio provides a common environment to be used as the simple development point that shares all code basis into one stream. An optimization framework consists of the skin concept (runtime skinning) that actually enables an interface for mobile applications depending on the device. This feature enables the runtime interface and enables different sets of customizations. All these settings are device dependent and can easily be transformed to hold any set of code.
Worklight Studio can be used to develop a component called IBM Worklight Adapters for your application within the same integrated development environment. It allows you to test these adapters thoroughly. It also provides a browser-based mobile simulator for testing web and hybrid applications within IBM Worklight Studio. Mobile simulator is a cross-platform testing module for mobile devices with the support of various Apache Cordova APIs. It allows you to test hybrid applications that use device features without having to run them on the physical device. This reduces redundant development time and effort required for repeated deployment on devices.
Besides this, IBM Worklight Studio allows you to set Ant tasks that can be used to run any mobile application on multiple platforms. IBM Worklight Studio is available in three editions. The Developer edition provides all of the tools needed to build a mobile application. The Consumer edition and Enterprise edition add enterprise-level security and integration with the IBM Application Center.
The IBM Worklight Device Runtime component delivers a smooth and uniform bridge between web technologies (HTML5, CSS3, and JavaScript) and the additional native functionalities added to the various platforms. IBM Worklight Device Runtime supports a variety of mobile OS and release levels.
The following screenshot shows the different features in Device Runtime that reduce the complexity and implementation time frame for a developer:

The following section provides details about the various features of Device Runtime:
Cross-platform Compatibility Layer: By using this layer, hybrid mobile applications can access common control elements such as tab bars, clipboards, and native device interface features.
Server Integration Framework: This allows applications to utilize a Server Secure Layer Connection to connect to the server all the time.
Encrypted Storage: This layer helps to access application restoration data in an encryption that helps a user to access data using this API.
Reporting for Statistics and Diagnostics: In this layer, the Mobile application transforms the data and sends it to IBM Worklight Server by executing an event that stores the data in a separate database.
This component is utilized to bind a client-side/server-side integration with built-in security prevention and helps the application to have a strong communication with the backend system. This complete framework based on the cryptographic module to protect user-specific information as well as server specifications. The following screenshot is of the structure of IBM Worklight Server:

The following is a brief description of the structure of IBM Worklight Server:
Server-side Application Code: This module defends the security and performance of a mobile device. By using this code, you can have direct access to the backend system or cloud-based services.
JSON translation: JSON is a lightweight data structure format, such as XML, that automatically converts hierarchical data responses with optimized consumption.
Authentication Framework: If your mobile application is based on Worklight Server, you can benefit from enterprise-class security, which enables single sign-on using Lightweight Third Party Authentication (LTPA).
IBM Worklight Console is an administration component based on the web interface. This web-based console is used to enable/disable applications, adapters, and push notification rules.
You can manage a mobile application by activating/deactivating its outdated versions. It can also be used to publish messages or notifications to users regarding new updates and new features released. Worklight Console contains an identifier to ensure security and application provisioning for users. This console also assists administrators with viewing statistics and user information from all running applications on IBM Worklight Server. This helps to make decisions regarding specific platforms, user interaction, and performance overview.
Worklight Application Center is a web-based internal enterprise store to centralize mobile applications, including distribution, installation, and feedback. An application catalog helps to find available mobile applications that provides feedback on application versions.
During the development lifecycle, Application Center can be used to inline the movements of new application versions from the development point of view. It allows multiple versions of applications and can also be utilized to limit versions for any group of users as well as applications.
In this chapter, we have covered the history and background of IBM Worklight, approaches used in mobile development and why Worklight is the right choice between other mobile application development solutions with its inline efficient tools and components.
In the next chapter, you're going to install Worklight (Worklight Studio and Worklight Server) to set up the development environment on your computer to manage your application's lifecycle from development to deployment. Moreover, you'll be guided in setting up the Android SDK within the same environment to test the application on an Android simulator. This will help you to run and follow along with the examples discussed throughout this book.