Worklight comes to Java ME
SrihariKulkarni 120000KKWK Visits (1409)
If you are a Worklight developer, you'd probably know that IBM Worklight 5.0.5 was released recently. Otherwise, you can read about it here.
So, the next obvious question is - what is new in Worklight 5.0.5 ? You can read about it here
While you had a look at what's new in Worklight 5.0.5, one of the things you'll have noticed that support for Java ME as a platform has been added. Although the number of smartphones have multiplied exponentially in the last few years, there is a large user base especially in emerging economies with phones capable of running Java ME. Nokia identifies this market as the next billion targetting the next billion new mobile phone owners. It is to cater to this market that Worklight 5.0.5 adds support to Java ME as a platform.
Read on to see how you can develop Java ME applications that can exploit the power of Worklight.
- An eclipse environment with the Mobile Tools for Java plugin inst
- And last, but not the least, Worklight Studio installed on the eclipse environment.
1. Create a new Worklight project
2. Worklight 5.0.5 offers the ability to write native applications that can make use of Worklight API calls. So, create a Native API app in the Worklight project that Java ME apps can connect to.
Choose Worklight Native API from the list
Then give a name to your app and choose Java ME as the environment.
3. Deploy the Worklight Native API app that you just created to the Worklight server
Visit the Worklight console and verify that the app has been successfully deployed.
4. Create a Java ME Midlet project and add a Java ME Midlet to it.
5. Add the necessary libraries to the Midlet project.
6. Copy the wlclient.properties file found in the Java ME Native app into the res folder of the Midlet project you just created. Following is a screenshot of how your app Midlet project structure should look after you've added the references.
Oh, and edit it to suit your requirements. Once you take a look at it, you'll find it pretty self-explanatory.
7. Thats it - you are good to go. You can now create a Worklight adapter and deploy it to the Worklight server and invoke procedures on this adapter from your Java ME application. Please see the following section for a sneak peek into the Java ME Worklight APIs
As of Worklight 5.0.5, you will be able to connect to a Worklight app and invoke a procedure defined in an adapter.
There are two steps to invoke an adapter procedure.
a. Create a WLClient object and connect to the Worklight server app.
b. Call the adapter procedure after a successful conn
You can see the tutorial and samples for Java ME here