|
» Two things that go well together: Web Runtime and Java » eSWT Article Posted » New Java Developer's Library » S60.com technology update on Java » New Java features of 3rd Ed. fp 2 |
|
» June 2008 » May 2008 » April 2008 » February 2008 » January 2008 » December 2007 » November 2007 » October 2007 » September 2007 » August 2007 |
|
|
Subscribe RSS 2.0 feed |
Subscribe Atom feed If you wish to receive email notification, please here » |
|
» All About Symbian » Symbian One » My-Symbian » Symbian.com » S60 Tips » S60 Freeware » Symbian Freak |
» Darla Mack! » Mobile Jones » MobHappy » The Mobile Weblog » Gadgets 4 Fun » Christian Lindholm |
Web Runtime and Java makes a delicious combination. They are the milk and cookies of S60 runtimes, tasty when consumed alone but delicious when together. Why should not they be, Java provides access to almost all the local device features today and web runtime brings all the goodness of the Web 2.0 applications and web based UIs.
I know you think that Java and Web Runtime does not have any built-in interoperability today, and this is almost true. So what is the catch? How can you create a widget that uses java APIs?
Starting with the S60 Feature Pack 2, java runtime introduced the new UI toolkit for Java, namely eSWT. eSWT includes an amazing component called Browser. Browser is one of the ~40 components of eSWT and its purpose is to provide access to the platform's native web browser. In our case, this is the S60 Browser Control. Using eSWT's Browser you can embed a browser into your Midlet. The end result is a Midlet that hosts S60's WebKit based Browser. Although it is not the purpose you can actually create your personal Browser with it, there is is a simple example on Forum Nokia wiki demonstrating this.
So what is the web runtime connection? Just like eSWT's Browser, the heart and soul of Web Runtime is S60 Browser. When eSWT initializes its Browser component, eSWT pretty much enables similar functionality to Web Runtime. As a result, all the AJAX programming available with Web Runtime is available but this time embedded inside a Midlet. Of course being embedded into a Midlet has advantages. Your web widget can now access all the local resources, use APIs like location and PIM and generate the content with the help of these Java APIs and set it to the Browser. It is even possible to mash up the local data with the online services, (Google Maps, Flickr etc.)
I've just posted an article discussing about the new eSWT UI API that is available in S60 Java from 3rd ed fp 2 devices. (Nokia has announced some of these devices already.)
The article was originally published in S60 News magazine. S60 News is a newsletter for S60 licensees, S60 Product Creation Community Members and Operators. Since eSWT is a new public Java API for rich user interface creation I thought it's best to make the article available to anyone. Here you go:
"Taking S60 Java Platform user interface capabilities to the next level"
Download PDF file
There's a new version of our Java ME Developer's Library available at Forum Nokia. It covers the announced new features of S60 Java available for developers.
We have Javadocs for the new APIs: eSWT and IAPInfo. You can also find API overviews and examples for these from UI and graphics and Networking sections, respectively. We've put back the Nokia UI API Javadoc as it's still used by applications and since the standard MIDP 2 API doesn't have all the functionality; we'll try to aim this with MIDP 3 standard in future.
The library also has significant update on MIDP implementation notes document. There we have a table of Nokia specific JAD and JAR attributes for easy reference. There's also Scaling topic about Canvas graphics scaling and scalable MIDlet icons, and a System properties table.
Recently we posted a short overview on M2G and eSWT APIs on s60.com:
Richer user experience with S60 Mobile Java
M2G allows to render SVG content inside Java applications, and it's already available in latest S60 and Series 40 devices out there (Nokia N95 etc.). It basically allows very easy way for reaching 2D graphics scalability. Making device resolution independent games has been hard this far and many games are simply fixed to certain resolution only. Game publishers had to do multiple variants for the same game for multiple resolutions. I'm eagerly waiting for some games to utilize this. Of course it's not just games the technology is targeted, you can use it also to create fancy looking 2D UIs.
We've announced already the new flexible UI toolkit eSWT in our previous post. eSWT is definitely the most biggest new feature in S60 Java Platform for developers in 3rd Edition Feature Pack 2.
But there's a lot more in the new S60 Java Platform. We have both, new API features and under-the-hood functionality. Below I'll try to list most of the nitty-gritty features. We'll be providing more information on how to use these via Forum Nokia Wiki site, and perhaps cover some in more details in future posts here too. They will also be covered in our reference documentation in Java ME Developer's Library when a 3rd Ed FP 2 version will be available.
New APIs available:
IAPInfo API allows to access device's Internet Access Points configuration and allows to specific explicitly for General Connection Framework network connections (http etc.) which IAP should be used.
New other functionality:
New architecture
Regarding under-the-hood functionality, the S60 Java Platform has gone through a big architectural change. We've changed the VM from a monolithic architecture to more flexible one. Prior to 3rd Ed fp 2, S60 Java had traditional CLDC VM architecture where all API code (class files) were compiled into the virtual machine executable. Now the Java API implementation code is no longer in the VM executable but will be dynamically loaded when needed.
The new architecture allows us to dynamically extend the virtual machine with new APIs. Which is exactly what is used e.g. in our eSWT implementation. When there will be new releases available from us for eSWT, we'll release that directly to developers. Anyone can install that upgrade package to 3rd ed FP 2 devices. Another result of the new architecture is of course memory saving: applications not needing some of the optional APIs wont have them in memory.
We also have changed the threading implementation. Now Java Threads are native. Each Java Thread has a native thread counterpart. Prior to 3rd FP2 the Java threads used so called light-weight threading (sometimes referred to as "green threads" which is a small misnomer) where Java VM had it's own thread implementation and scheduling. Now Java threads are scheduled by OS.
Runtime performance
On MMAPI we have done performance improvements. In overall the mixing of audio content now works lot better and playback latency is smaller. This means improvements to Java gaming experience. The media deallocation now properly frees the memory and concurrent number of players being in pre-fetch state is increased.
One smaller, but rather dramatic change has been implemented on LCDUI Canvas class. Previously each Canvas instance contained it's own double buffer for graphics contents. The size of the buffer image is the size of the screen so it consumes quite much runtime memory. Double buffering for Canvas is nowadays required feature by MIDP specification 2.1. If a MIDlet has multiple Canvas instances the memory may easily run out. On other platforms e.g. Nokia Series 40 had implemented different double buffering scheme: each Canvas instance simply shared the same double buffer. We at S60 Java decided to implement the same scheme and as a result we are behaving the same with Series 40 devices.
The beta version of the java SDK for S60 3rd edition FP 2 is available. SDK comes with all the essentials for starting with developing java applications for the next version of S60. It includes the device emulator, implementations for java APIs and the documentation with code examples.
Speaking of documentation, Forum Nokia wiki is another source which I favor. Wiki content includes code examples, how to's, small tutorials and is a real community effort. The information is not only provided by the people behind the Forum Nokia and S60 java platform but also by the S60 developer community at large.