IBM Worklight, Hybrid Apps Made Possible for Apple iOS and Android


David Wilkerson

 by David Wilkerson, CTO

Welcome to mobility, IBM? This year IBM acquired Worklight, an interesting product for developing hybrid mobile apps. The tool was widely discussed at the IBM Exceptional Web Experience event in Austin, TX and although I was not able to attend I heard some of the buzz. Intrigued, I decided to develop an iPhone app using Worklight.

Let me start with a caveat. I have downloaded hundreds of tools for preview and in almost every case found the documentation to be sadly deficient, the tool to be somewhat buggy, and the features to be less than exciting. The process I am about to describe was exceptional. Of course my app is nothing more than “Hello World,” or in this case “Hello Worklight,” but contrary to past experience, Worklight was a pleasure to work with.

The tool consists of several moving parts and because I wanted to develop the app for an iPhone or an iPad, I needed to work on my Mac. Why? Because the native code for iOS environments can only be manipulated with Apple’s SDK.

Visit the download site for instructions to download, install, and configure the parts needed to start developing. You will need your IBM ID to access the page.

On the instruction page there are six steps:

(1)  Download and install MySQL (Mac or Windows)

(2)  Download the JDBC driver for MySQL

(3)  Download the Worklight Server

(4)  Download and install Eclipse (I used their link and installed the Indigo edition)

(4) Download and install Eclipse (I used their link and installed the Indigo edition)

(5)  Installed the trial version of the Worklight plugin.

(6)  Configured my development environment as described in the Getting Started tutorial.

To create a mobile solution using Worklight the developer will first create a Worklight project and then an application. The project is displayed in the project explorer window and there were a number of familiar folders. The project folder structure is initially very simple with containers for adapters, apps, bin (binaries), and lib (libraries):

The project folder structure is initially very simple with containers for adapters, apps, bin (binaries), and lib (libraries)

Adapters are the server side code that connects to enterprise resources such as database applications. The adapter framework uses JavaScript and XSL and developers often transform the backend data to JSON.

Apps are the programs downloaded to a mobile device and execute OR they are a mini web application using HTML, JavaScript, and CSS. The latter are often regarded as widgets or gadgets.

The bin directory and the lib directory are for deliverable and 3rd party libraries associated with the project.

Development is done in one or more “environments.” The default environment is called common.  This environment contains resources that are shared among any other environments. In my case, I wanted to create an iPhone application. To do this I add a new environment using the context menu available on the app folder.

To do this I add a new environment using the context menu available on the app folder.

In addition to CSS, html, and JavaScript files, there is a folder for legal docs and an application descriptor.

Once I added my iPhone environment I decided to test the app. In order to test the app on the iPhone I had to first build and deploy the app to the Worklight server. This is easily done with the context menu of the app folder.

This is easily done with the context menu of the app folder.

In the web console of the Worklight server is a preview option that will display the app in a conventional browser interface.

In the web console of the Worklight server is a preview option that will display the app in a conventional browser interface.

After previewing the app through the console I proceeded to deploy the app to XCode. XCode is the Apple development environment of iOS development. You have to register as an Apple Developer and join the program in order to obtain the SDK. The development tools also include the iOS simulator for various versions of the operating system. To access this preview I used the context menu of the iPhone development environment I added earlier to Run As Xcode project.

To access this preview I used the context menu of the iPhone development environment I added earlier to Run As Xcode project.

XCode will open and the iPhone app project is imported into the tool. The tool validates the app and then launches the simulator.

The tool validates the app and then launches the simulator.

The Preview

In order to do anything “interesting” with the app, the developer is required to define an adapter to interact with a backend system. In an article on his private blog, Sunil Patil, a WebSphere Portal consultant, describes his experience defining an adapter. Patil concludes that the tool itself is simple and seems stable. The key component is the Worklight server, as this is the platform responsible for integration with the enterprise.

Whether the market will accept the notion of hybrid apps is not something I can decide just yet. However, it seems clear that the market wants more than a web only app solution. Can Worklight deliver this?  I think there are some real possibilities but only time, and IBM’s intention for the product, will tell.

———————————————————————————————————————————
This article is from our monthly resource e-Newsletter. Did you miss it in your inbox? Visit our eNewsletter archives for past editions or if you want to receive our monthly newsletter automatically, simply write to Ruth Jarvis and request to be added to our E-Newsletter list. Thank you!

10 comments on “IBM Worklight, Hybrid Apps Made Possible for Apple iOS and Android

  1. Pingback: Worklight: A Mobile Solution from IBM « Taking Notez

    • What a great question! At this time Worklight is not integrated with Web Experience Factory. I would love to see it happen. From a development perspective one obstacle is that Web Experience Factory does not install on a Mac. This limitation would need to be overcome if an organization wishes to create hybrid apps that execute on an iOS device like an iPhone because the software development kit for iOS is Apple’s XCode tool. I don’t think there would be a huge hurdle to overcome for Web Experience Factory to run on a Mac since it has a Unix foundation and WEF works fine on LInux. Another factor that would probably require a larger investment from IBM would be to redefine the Worklight tooling as WEF builders. Again, this is not an impossible task but one that requires investment from IBM. I am presently reviewing some articles by IBM in Ireland that may shed some light on the future of Worklight as it relates to IBM’s larger mobile strategy. One thing is certain, IBM needs to and probably will continue to invest in mobile platforms and related tooling which could mean a bright future for Worklight.

  2. Whether the Hello Worklight app can be developed without using worklight server to install in android devices?

  3. Got it ! we need to give this “connectOnStartup:false” inside the init function in body onload function

  4. Looks like a perfect solution for hybrid development inc security aspects to back end. However, do you need to have IBM web sphere as th back end and I suspect this is where the high costs start.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s