Sun Java Solaris Communities My SDN Account Join SDN
 
Article

What's New in Sun Java™ Wireless Toolkit 2.5 for CLDC

 
By Dawn Phillips, February 5, 2007  

Sun Java™ Wireless Toolkit 2.5 for CLDC adds a new platform definition, the Mobile Service Architecture (JSR 248), and nine new optional APIs. In addition, this release maintains our high standard of quality, includes fixes for known bugs and new demos to showcase the new APIs.

Like JSR 185 (Java Technology for the Wireless Industry ) the Mobile Service Architecture MSA is an "umbrella" JSR that supports specific combinations of the Mobile Information Device Profile (MIDP) , the Connected Device Limited Configuration (CLDC), and optional JSRs. Support for updates to JSR 118 (MIDP 2.1) is new in this release.

  • Security and Trust Services APIs for J2ME (JSR 177) defines four groups of APIs that support smart card access and cryptographic capabilities, including creating and signing certificates.

  • Location API for J2ME (JSR 179) enables developers to write applications to interface with devices that are equipped with Global Positioning System (GPS) or other hardware used to determine where the device is located.

  • SIP API for J2ME (JSR 180) implements the Session Initiation Protocol, a standard protocol for setting up multimedia sessions.

  • Content Handler API (JSR 211) provides a mechanism to assign a content handler to a media type and launch the associated handler when incoming content is recognized.

    Scalable 2D Vector Graphics API for J2ME (JSR 226) provides MIDlets with an API for displaying SVG content.

  • Payment API (JSR 229) provides a standard way for applications to allow users to make payments.

  • Advanced Multimedia Supplements (JSR 234) extend the Mobile Media API (JSR 135) with 3Daudio, audio effects, and camera support.

  • Mobile Internationalization API (JSR 238) defines a resource file mechanism for making applications available in multiple languages.

  • Java Binding for the OpenGL® ES API (JSR 239) defines the Java programming language bindings for two APIs, OpenGL® for Embedded Systems (OpenGL® ES) and EGL. OpenGL® ES is a standard API for 3D graphics. EGL is a standard platform interface layer. Both OpenGL® ES and EGL are developed by the Khronos Group (http://khronos.org/opengles/).

If you are new to MIDP, this page will get you started: Learning Path: Getting Started with MIDP 2.0

Contents
 
Security and Trust Services APIs for J2ME (SATSA)
Location API for J2ME
Start Something with Session Initiation Protocol (SIP)
Content Handler API
Display Interactive Pictures or Animations Using SVG Content
Make It Easy for Users to Pay You
3D Graphics and 3D Sound
Create Global Applications
Summary
 
Security and Trust Services APIs for J2ME (SATSA)

JSR 177 provides smart card access and cryptographic capabilities to applications running on small devices. JSR 177 (the SATSA specification) defines four distinct APIs as optional packages:

  • SATSA-APDU - Enables applications to communicate with smart card applications using a low-level protocol.
  • SATSA-JCRMI - Provides an alternate method for communicating with smart card applications using a remote object protocol.
  • SATSA-PKI -Enables applications to use a smart card to digitally sign data and manage user certificates.
  • SATSA-CRYPTO - A general-purpose cryptographic API that supports message digests, digital signatures, and ciphers.

The toolkit provides a simulator for specifying the card slot and application .

Location API for J2ME

JSR 179 provides a standard interface to location information. A location provider encapsulates a positioning method and supplies information about the device's location. The application requests a provider by specifying required criteria, such as the desired accuracy and response time. If an appropriate implementation is available, the application can use it to obtain information about the device's physical location. The toolkit includes a simulated location provider with which you can use the emulator's External Events window to specify the emulated device configuration. In addition, you can configure the properties of the provider itself, and you can manage a database of landmarks. As shown below, the device is transmitting a signal that a mapping application can detect. As the device moves, the mapping application displays landmarks that are within range.

 
Start Something with Session Initiation Protocol (SIP)

SIP provides a standard way for applications to set up communications. The application determines what communication actually takes place. SIP can be used to set up instant messaging, text chat, voice chat, video conferencing, or other types of sessions. SIP is defined by RFC 3261.

The Sun Java Wireless Toolkit for CLDC supports the SIP API for J2ME (JSR 180) with a proxy server, registrar, and network monitor support.

A SIP registrar allows client applications to associate a user name with a specific network address. In essence, registering provides a way for a user to say "Here I am!"

A SIP proxy server is really just an entry point into a larger network of proxy servers. SIP messages that arrive at one proxy are routed to an appropriate destination, which is usually another proxy server or an endpoint, like a desktop computer or a mobile device. Although SIP messages can be sent directly between devices, they will usually be routed through a proxy server.

For example, suppose Dave wants to start a video conference with Polly. Polly is on the road and her mobile phone sends a message to a registrar that associates her name with the mobile phone's network address. When Dave tries to set up the video conference with Polly, his application uses SIP to ask the registrar for Polly's current network location.

The Sun Java Wireless Toolkit for CLDC includes a very simple SIP proxy and registrar server that you can use for testing applications that use the SIP API. In addition, you can configure the toolkit to use an external proxy server and registrar server.

SIP Proxy & Registrar Window
 

The toolkit includes two example applications (with source code) that demonstrate the use of the SIP API. The GoSIP and SIPDemo applications are fully documented in Appendix A of the Sun Java Wireless Toolkit for CLDC User's Guide. In addition, Chapter 15 of the User's Guide contains instructions on using the SIP Server and examining SIP messages using the network monitor.

Content Handler API

JSR 211 specifies a system by which MIDlets can be launched in response to specific types of content. In KToolbar you can specify the viewer, player, reader, or other application to launch when based on the incoming file type.

Display Interactive Pictures or Animations Using SVG Content

The Sun Java Wireless Toolkit for CLDC emulator support JSR 226, the Scalable 2D Vector Graphics API for J2ME. SVG is a standard defined by the World Wide Web Consortium. It is an XML grammar for describing rich, interactive 2D graphics.

While it is possible to produce SVG content with a text editor, most people use an authoring tool. Some possibilities are Adobe Illustrator and Ikivo Animator.

The toolkit includes an example, SVGDemo, that shows how to generate and render SVG content. SVGDemo contains three MIDlet that demonstrate several approaches to displaying SVG content.

play SVG animation
 
Make It Easy for Users to Pay You

JSR 229, the Payment API, gives applications the power to make payments on behalf of their users. The Payment API supports different payment mechanisms through payment adapters. A device that implements the Payment API will have one or more adapters. MIDlet suites use descriptor attributes to specify what types of payment adapters they can use.

The Sun Java Wireless Toolkit for CLDC's emulator implements the Payment API with an example payment adapter that simulates both Premium Priced SMS (PPSMS) and credit card payments. In addition, the toolkit makes it easy to set the necessary attributes in the MIDlet's descriptor and JAR™ Location API for J2ME file manifest. Finally, a payment console allows you to easily track payments made or attempted by an application.

Payment Service Provider Console
 

The toolkit's emulator keeps a history of payment transactions (as required by the JSR 229 specification) which can be viewed at any time in the emulator's External Events window.

Because the Payment API is closely tied to provisioning and external device payment mechanisms, and because payments can only succeed in a trusted protection domain, you should always test and debug your Payment API applications using the toolkit's Run via OTA mechanism. See the User's Guide for the full details.

3D Graphics and 3D Sound

3D graphics are becoming commonplace on mobile devices. Along with these advances, however, comes a somewhat less intuitive technology, 3D sound. The goal is to create the effect of sound in three dimensional space around a user. Headphones are necessary, and sophisticated audio processing is used to make users believe that sounds have a specific spatial origin.

JSR 239 (Java™ Binding for the OpenGL® ES API) can be useful to developers familiar with OpenGL®. While JSR 184 (which is object oriented) requires high level functionality, OpenGL® is a platform-independent low level graphics library that is suited for accessing hardware accelerated 3D graphics. For users familiar with OpenGL®, moving applications from Java SE to Java ME, and vice versa just got easier.

JSR 234, Advanced Multimedia Supplements, extends the Mobile Media API (MMAPI, JSR 135) with additional controls for three dimensional sound and defines other advanced multimedia capabilities such as camera control, image processing, radio tuner control, and audio effects like reverberation.

To experience the new capabilities, try running the AdvancedMultimediaSupplements example. Wear headphones if you are going to try out 3D audio.

Create Global Applications

To make your application widely appealing, you should be able to offer versions of it in multiple languages suitable for users around the world. The JSR 238 Mobile Internationalization API provides a resource-based scheme that makes it easier to create global applications.

In addition, the toolkit includes a resource manager to help with the task of creating resources for different languages.

i18n Resources Manager Window
 

To understand the use of the Mobile Internationalization API, check out the i18nDemo project, which includes a simple phrase translator as well as demonstrations of sorting and formatting in different languages and countries. You can use the phrase translator to find out how to ask for a beer in seven different languages.

Summary

With support for the new Mobile Service Architecture platform, the toolkit supports more than a dozen optional APIs. The toolkit simplifies your build environment because it offers five predefined target platforms. Download 2.5 today!

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.