IBM Worklight provides an open, comprehensive and advanced mobile application platform that can help you efficiently develop, run, and manage HTML5, hybrid mobile, and native applications, using standards based technologies and tools, mobile-optimized middleware, a variety of security mechanisms, and integrated management and analytics capabilities.
With IBM Worklight, you can efficiently manage the development and maintenance of multiple, optimized versions of your mobile applications. Mobile applications targeted to different mobile operating systems (such as Android, iOS, and others) can be built in a uniform fashion. Because a large percentage of the common code base is shared across different operating systems, the ability to rely on ready-made components and to share device-independent sections of code drastically reduces development time. Mobile applications (apps) delivered through IBM Worklight leverage common web technologies across multiple devices, without sacrificing the ability to tap the power of native technologies and tools, such as Objective-C, xCode, or Android. As such, native code can also be added to applications targeted to specific operating systems, if desired. Features of specific mobile devices can be accessed by your applications using IBM Worklight API or native API combined with the shared common code base.
IBM Worklight components
The IBM Worklight platform consists of four main components:
IBM Worklight Studio is an Eclipse based integrated development environment (IDE) that enables you to perform all the coding and integration tasks required to develop a fully operational mobile application for various mobile operating systems. Eclipse users will find IBM Worklight Studio easy to use with little or no additional learning required for developing mobile applications with the assisted code development features.
IBM Worklight Server is a Java™-based server that is a scalable gateway between applications, external services, and the enterprise backend infrastructure. The server contains security features to enable connectivity, multi-source data extraction and manipulation, authentication, direct update of web and hybrid mobile applications, analytics, and operational management functions. IBM Worklight Server supports IBM WebSphere Application Server and Apache Tomcat run time environments for executing IBM Worklight applications.
IBM Worklight Device Runtime Components consist of client-side run time code that embeds server functionality within the target environment of deployed applications.
IBM Worklight Console is a web-based administrative console that supports the ongoing monitoring and administration of the IBM Worklight Server and its deployed applications, adapters, and push notifications. You can also use the console to manage different versions of mobile apps and send any notifications to application users.
The following figure shows the four main IBM Worklight components and their interaction with each other.
Setting up IBM Worklight environment
Since IBM Worklight is a relatively new product for many developers, we provide basic setup information here to help you get started. For other products and tools that are used for the use cases in this wiki (such as IBM Web Content Manager (WCM), WEF, and RAD), we mostly provide existing information and documentation's links and references. See the reference information section below.
The IBM Worklight Developer Edition is a self-contained, easy-to-install plugin for the Eclipse IDE (Indigo and Helios). The plugin includes development tooling as well as a built-in application server, so you can easily develop, test, and deliver your mobile apps without installing or configuring anything else. The Developer Edition is free for evaluation purposes.
To set up the IBM Worklight environment for application development, you must first download and install IBM Worklight Developer Edition, install device specific SDKs, and install the plugin for Eclipse.
Download and install IBM Worklight Developer Edition
To download and install IBM Worklight Developer Edition, follow this procedure:
1. Install Eclipse Indigo (3.7.2), either Eclipse IDE for Java EE Developers or Eclipse Classic, if you do not have it on your system.
To install, download and unzip the Eclipse to your preferred location. Set the Workspace according to your preference.
IBM Worklight currently runs on Eclipse Indigo (2011, 3.7 release) and Helios (2010, 3.6 release), but not on Juno (2012, 4.2 release).
IBM Worklight requires Java JDK version 6 or later (check that the eclipse.ini file contains the line Dosgi.requiredJavaVersion=1.6).
2. Use the link below to download the free developer edition:
3. You will be presented with a form to complete. Fill all fields, then click Next. The installation procedure ask you to install IBM Worklight as a plugin.
Tip: Both Rational Application Developer and IBM Web Experience Factory are based on Eclipse. This means that you can install all the packages on the same Eclipse installation. However, it is recommended to use a separate Eclipse installation for Worklight.
4. Start Eclipse, then select Help -> Install New Software.
5. On the Available Software page, click Add.
6. In the Add Repository window, enter "IBM Worklight" for the Name, and paste the following URL into the Location:
7. Click OK. Wait a few moments until you see that the site has become available.
8. Select IBM Worklight Studio Development Tools. You will see three packages available for download. Click Next.
9. Click OK and then click Finish to begin the download and installation of the new software.
10. Restart IBM Worklight. Once you see this in the console, you know that IBM Worklight is up and running.
Install device-specific SDKs
When you are developing for Android, iOS, BlackBerry, and Windows Phone, you must use specialized SDKs from these vendors.
Set up an Android development platform
To set up development environment for an Android phone, follow these steps:
1. Download the Android SDK environment:
If you are using a Mac OS x or Linux, unzip the Android SDK on a non-temporary directory.
2. Depending where you extracted the SDK, go into the "tool" folder, and run the comand ./android sdk
3. Download the SDK and platform.
Note, you have the options to download many SDK and platforms for the different releases of Android. At a minimum, you have to install the SDK platform tool and one System Image for at least one Android level to be able to define one Android Virtual Device to test your configuration. If you do not download a System Image, it will result in an exception of “Unable to find userdata.img exception”. If you are uncertain, simply download everything under a single Android release.
4. Go back to Eclipse development and go to Help -> Install New Software.
5. Click Add. Enter the name and location of the ADT plugin and click OK.
For our example, we enter "AndroidPlugin" as the plugin name and "https://dl-ssl.google.com/android/eclipse/" as the location.
If you have troubles while installing the plug-in, use “http” instead of “https”.
6. Select both features, Developer Tools and NDK Plugins. Click Next to proceed.
7. Now select the path of the SDK you downloaded before.
8. You should be able to see that your toolbar has changed with the addition of the Android Virtual Device (AVD) icon.
9. Click this icon to define a new Android Virtual Device (AVD) to test our projects. Click New.
10. Enter the appropriate information for the new device, and click Create AVD.
You have now created an AVD to test your configuration. We are now ready for development with IBM Worklight and Android!
Developing a simple IBM Worklight application
To develop a simple IBM Worklight application, you need to create a new IBM Worklight project, a new application in the project, then start the IBM Worklight server, and test it.
Create a new IBM Worklight project
Follow these steps:
1. Navigate to File -> New -> Worklight Project, as shown in the following figure. If Worklight Project is not listed, try File -> New -> Other -> Worklight Project.
2. Enter a name for your project, for example, "Todo Project." Then click Next.
Add a new application to the Worklight project
After you create a new Worklight project, you can add a new application in the project.
To add a new application to the Worklight project, follow these steps:
1. Select Hybrid Application then click Next.
2. Enter a name for your application, for example "Todo". Click Finish.
Start Worklight server and test the application
To test the application that you just built, you need to publish it to a local Worklight server.
IBM Worklight Studio v5 contains a local server that can be used to test the application you created above by building and running the app. Right-click on the application and select Build All and Deploy. This starts the local server on port 8080, activates the project, and deploys the application for you to test in a browser.
You can see the progress of the events in the console below.
Now you can access the local server's server console by navigating to http://localhost:8080/console in your browser. You should see the Todo application that you just deployed.
The following use cases described in this wiki also show how IBM Worklight can be used to develop hybrid mobile apps:
This article provides an overview of IBM Worklight and its development only.
For information on IBM Worklight, refer to the following links: