Sun Java Solaris Communities My SDN Account Join SDN
 
Technical Articles and Tips

Akhil Arora and Vincent Hardy of Sun Microsystems - Java ME Luminaries at JavaOne 2007

 
By Richard Marejka, May 2007  

Akhil and Vincent will speak about Ajax for the Java ME platform early Wednesday (JavaOne day 2) evening. It promises to be an engaging session. I know that Akhil has been busy writing some killer samples for the event and for download by the community. Plan to attend their session on Wednesday, May 9 starting at 6:35 pm.

Q. How long have you been working with Java technology and on the Java ME platform at Sun?

Akhil: With Java technology for about 11 years, at Sun for 10 and with Java ME since last year. Have worked with Java ME in other projects before that.

Vincent: I have been working with Java technology for about 11 years, and at Sun for 10. I moved the the Java ME organization about 5 years ago.

Q. What attracted you to the Java ME platform?

Vincent/Akhil: It is a very attractive platform. Java ME has many APIs to access device features, such as location, address book, networking, or payment. In addition, as geeks, we find it is an interesting challenge to get code running under tighter constraints than on the desktop. Simplicity and the lack of bloat is also attractive.

Q. Do you participate in any standards bodies/professional organizations, the Java Community Process (JCP) for example?

Akhil: Not as of this moment. I prefer to write code rather than specifications. In the past, I have represented Sun on several SOAP-based Web Services specification related to systems management - WS-Management and WS-CIM, which were standardized at dmtf.org. I created Java SE implementations of these in open source at https://wiseman.dev.java.net. Represented Sun at several interop events with implementations from Microsoft, Intel and others. These days I'm working to bring the Web 2.0 to Java ME. My goal is to make it really easy for Java ME applications to invoke Web 2.0 services - to be able to easily retrieve information from them and to publish information to them.

Vincent: I am an standard afficionado :-) Over the years, I've participated in the W3C (World Wide Web Consortium) working groups on Scalable Vector Graphics and Compound Document Formats. In the JCP, I worked on JSR 226, 287 and 290. But my heart is in development: I love writing code, and my job is to develop graphics and animation engines.

Q. What are the biggest technical advancements you have seen in the Java ME platform?

Vincent/Akhil: There are so many that it's hard to pick the most relevant one. Several years back, JTWI (Java Technology for the Wireless Industry) was a big step in getting a consistent, powerful platform on the vast majority of phones. Now, with MSA (the Mobile Service Architecture, JSR 248), this common platform is becoming even more powerful with very sophisticated features such as payment, location, or advanced graphics and animations. This is a major technical advancement. It takes a lot of efforts to get the industry to agree on a common set of APIs to be deployed on phones, so that application developers can rely on them. Not many technologies can offer a consistent API set and access to device features as widely as Java ME can.

Q. For the n00b (read: new user, novice), how would you explain Ajax and Mobile Web 2.0?

Akhil/Vincent: Ajax usually stands for "Asynchronous JavaScript and XML," even though it's not an acronym. The term really describes a now-common client design where applications retrieve data asynchronously from one or multiple web services. The data can be XML, but it can also be in other formats, such as plain text or, for example, the popular JavaScript Object Notation (JSON). Mobile Web 2.0 is about bringing Web 2.0 (e.g., scripting techniques like Ajax, service mash-ups, RESTful Web Services, the writable Web, user-generated content, blogs, social networks) to the Mobile platform and Java ME in particular.

Q. Does Ajax displace or enhance existing technology?

Akhil/Vincent: So far, Ajax has changed the way Web content operates and dramatically improved the user experience on the Web by not requiring the entire page to be refreshed, and by integrating content from web services.

Q. Is Ajax directed more towards the CDC or CLDC environment?

Akhil/Vincent: The concepts of Ajax, the idea of keeping an interactive user interface while asynchronously retrieving data, is not specific to any given platform. We feel the concepts can be applied to both CDC and CLDC.

Q. What's needed to provide Ajax on the ME platform?

Akhil: On the service interaction part, I have developed libraries to make it easier for developers to interact with Web Services. I have focused on making it as trivial as possible to process the information retrieved from services (e.g., Twitter, Flickr or Yahoo! Local) and update the user interface in response to that.

Vincent: For the user interface part, we can use Akhil's libraries with a traditional MIDP user interfaces. However, the match with the high quality, interactive and animated graphics JSR 226 provides delivers a very powerful solution. In particular, the Document Object Model (DOM) used in JSR 226 provides a similar model as used for traditional Web Ajax applications. It is easy to match the data retrieved from services to specific graphics and nodes in the DOM tree.

The components of this Mobile Web 2.0 middleware include, as of this time:

  • The equivalent of XmlHttpRequest for Java ME for asynchronous interaction with web services
  • A simple XPath-like expression language that abstracts low-level data format parsers and allows applications to declaratively extract information from structured data, simplifying application code
  • A streaming library for processing Atom and RSS feeds in constrained environments

Q. How does Ajax on the ME platform differ from Ajax on the desktop?

Akhil/Vincent: On the desktop, Ajax applications are typically found in browsers. They are a combination of ECMAScript, data feeds (XML, JSON or others) and they run in a browser. On the Java ME platform, the Mobile Ajax applications are built using Java instead of ECMAScript, and they do not run in the context of a Web browser.

An advantage of running outside the browser is that all of the platform's capabilities become available to the application. For example, a Java MIDlet application has access to the phone's camera (if so equipped), its geographic location (if so equipped), nearby devices (via bluetooth or near-field communication, if so equipped), and also has access to a user's personal information (if so permitted) - the phone's addressbook and calendar, etc.

Interesting applications can be built by combining (mashing-up) information from these multiple sources and remote web services, limited only by application developers' imaginations. We just want to highlight what is possible.

Q. What tools do you need to start using Ajax on ME?

Akhil/Vincent: You can get started today, since there are a lot of tools to write Mobile Ajax applications. For example, NetBeans 5.5 and its Mobility Pack contain support to emulate the Mobile Service Architecture. There are many different ways to debug and build an application. Beyond the traditional IDE features, there is special help to, for example, monitor the network traffic between the phone emulator and the Internet. On the user interface side, JSR 226 is supported in the NetBeans mobility pack and lets the developer visually inspect a Scalable Vector Graphics DOM tree, to discover its structure, visual and animated content.

Q. What will Ajax on Java ME provide that cannot be done today without Ajax?

Akhil/Vincent: Ajax on Java ME is about making things easier and flashier. The functionality that Mobile Ajax applications rely on is present. The desing of the Mobile Ajax applications and their user interface allows developers to more easily leverate existing functionality.

Q. Could you provide a few examples of Ajax on the Java ME platform that are available today?

We are not sure if pasting code here would be appropriate - we should point people to the technical session, the Hands-on-Lab on Friday and the ME app developer project that you've listed below.

Q. Will MSA accelerate the adoption of Ajax on the ME platform?

Akhil/Vincent: Yes, we think so. MSA is really a premium development platform because it has a lot to offer: Messaging, 2D and 3D graphics, Multimedia, Bluetooth, File and PIM (Personnal Information Manager), in addition to MIDP and LCDUI. And this is only for the MSA subset. The full MSA stack (which is starting to ship on phones now) also has location APIs, payment and more. With Mobile Ajax on Java ME, it is possible to tie in and combine (people often say mash-up) web services and present them to the end user. Because of the access to the phone features and the user's information, we feel we have a compelling platform for developers. However, it can be daunting, because there a many features to leverage, so efforts like Mobile Ajax to simplify the developement should be attractive in that context.

Q. Any questions / statements you would like to add before JavaOne?

Akhil: Well, we'd like to let people know that our libraries for integrating Web services on JavaME are open source and available at https://meapplicationdevelopers.dev.java.net/. We are also working on code samples and demos so developers can get started with the examples we will be showing during our session.

We would also like to mention that this code will be available using a very liberal license for users to take, tweak, improve, and use in their own applications. Of course, if people make improvements, we would like very much to see them contributed back using the same license so that everyone can benefit.

It is our hope that if many people find this useful, it gets standardized and finds its way into every handset. Please lobby your JCP rep if you find this useful.

Rate and Review
Tell us what you think of the content of this page.
Excellent   Good   Fair   Poor  
Comments:
Your email address (no reply is possible without an address):
Sun Privacy Policy

Note: We are not able to respond to all submitted comments.