Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 4 - Pages: 1  
Threads: [ Previous | Next ]
  Click to reply to this thread Reply

Mobile Ajax and SVG: Filthy Rich Mobile Clients.

At 10:42 PM on Sep 19, 2007, Daniel MD wrote:

As cellular network cost becomes more affordable, and phones with Wi-Fi connectivity more prevalent, you can expect more advanced networked application to emerge from a market dominated by Java games. Enterprise applications and Social network services (like meetmoi ) will be even more important on the mobile platforms than they are on the desktop. Think about it, whom do you know that doesn?t have and carry a cell phone all the time, every time?

So is the mobile platform ready to accommodate the needs of simplistic, easy to use UIs? If you ever did any mobile web surfing (on WAP), you will find it much less rich that the traditional web experience, and most of the time clumsy to navigate, without a mouse or pointer, navigation becomes much harder. This means that a window of opportunity is upon us. The ?Filthy Rich Mobile Clients?. These clients need to have responsive and good-looking user interfaces. Let us see how you can use a combination of AJAX-y libraries and SVG to create such applications.

Mobile AJAX !=AJAX in your Mobile

Currently you have the option to use Opera Widgets (for those who do not know, the Opera browser has a very high market share of mobile& embedded web browsers, and it?s also on the Wii)




Here are a few screenshots of Ajax Widgets.

Other JavaME commercial solutions exist to enable the development of rich mobile interfaces. However, this article deals with Sun?s Akhil Arora, Mobile AJAX for Java ME and SVG.

Arora, created a series of libraries (fits into a 30 kilobyte library) that enable the creation of AJAX-y J2ME applications, these are BSD licensed.

These libraries work outside of the web browser space, where usually your AJAX applications live. Therefore, I like to call this type of application a ?Filthy Rich Mobile Client? (I do give full credit to Romain Guy for the term), instead of a Mobile Ajax application.

Your usual AJAX application works somewhat like this:
XMLHttpRequest+XML/JSON+JavaScript+DOM = AJAX

On the mobile here is how AJAX works


-diagram from JavaONE slides

On Mobile AJAX we don't have XMLHttpRequest (XHR). We have com.sun.me.web.request - Asynchronous I/O for Java ME, this library uses the GCF (generic connection framework) ? Provides an equivalent behavior of XmlHttpRequest for Java ME (with some additional functionality useful for invoking RESTful web services. The library has both Synchronous and Asynchronous versions of Http GET and POST. What is cool about the GCF is that you can connect to more than HTTP servers, you can use SMS (the library supports Multipart MIME), Bluetooth, whatever is available to the phone. The library comes with progress listeners/callbacks (readProgress and writeProgress), this allows you to do progress bars; on slow networks this is very important to the user perception.

After you do a request, you receive an object, this object can be in XML, JSON or your own format. To traverse the data structure, you need to use com.sun.me.web.path - An Expression Language for Java ME, this language can be considered as a small subset of XPath. It allows to easily extract primitive types. The library automatically recognizes the data format that is being used and parses the information using the proper parser. This library is implemented on top of org.json.me that is also available under the same license.

Finally, we have a utility library to access ATOM/RSS feeds com/sun/me/web/atom/ - this allows you to easily create feed readers, and also limited support to publish ATOM RSS feeds.

So, now that we have the data, and have parsed it, we need to render/present it. You can do this using the LCDUI components or you can do SVG DOM tree manipulations, for truly rich scalable applications, that do not depend on MIDP implementation to set your application look.


-this diagram illustrates the rendering options available right now, and also pending ones like JSR 290

Here you can see several examples of Filthy Rich Mobile
Applications, the source code for these applications is available at https://meapplicationdevelopers.dev.java.net/





These applications are available for testing using the mpowerplayer, requires Java WebStart

As you can see, making attractive mobile UIs is not that difficult. I hope this overview of the Mobile AJAX API will enable you to develop Filthy Rich Mobile Clients. It is not unusual to see amazing mash-up application, using severeal APIs like camera, location API, GPS via bluetooth, etc.

Mobile AJAX is coincidently this week?s topic of the Java Mobile Podcast 20: Mobile AJAX
1 . At 8:18 AM on Sep 20, 2007, JD wrote:
  Click to reply to this thread Reply

Re: Mobile Ajax and SVG: Filthy Rich Mobile Clients.

more (also mobile) SVG on http://svg.startpagina.nl
2 . At 11:06 AM on Sep 20, 2007, phil swenson wrote:
  Click to reply to this thread Reply

Re: Mobile Ajax and SVG: Filthy Rich Mobile Clients.

SVG is dead. Sorry.
3 . At 9:03 PM on Sep 20, 2007, Rocco wrote:
  Click to reply to this thread Reply

Re: Mobile Ajax and SVG: Filthy Rich Mobile Clients.

per definition Ajax is a browser-based technology, so actually Mobile AJAX == AJAX in your Mobile and it is browser based .

so called filthy rich clients (e.g. mojax, javafx) might do things similar to Ajax, but it's not Ajax, it's not even using a XHR object. it's a bit riding the bandwagon going on here...

oh and having to sign up to comment and the signup form on javalobby sucks rocks. best, rocco
4 . At 3:23 AM on Sep 21, 2007, Lukas Hasik wrote:
  Click to reply to this thread Reply

Re: Mobile Ajax and SVG: Filthy Rich Mobile Clients.

Module with all the MobileAjax samples for NetBeans 5.5.1 with Mobility Pack. Just install the NBM module to NB 551 and all the samples will be there.

http://wiki.netbeans.org/wiki/view/MobilitySamplesMobileAjaxForNB551

thread.rss_message