march 2010 java™ platform, micro edition, cldc – midp 2 · for more information about these...

47
Developers guidelines March 2010 Java™ Platform, Micro Edition, CLDC – MIDP 2 for Sony Ericsson Windows Mobile® 6.5 phones

Upload: letram

Post on 18-May-2018

215 views

Category:

Documents


1 download

TRANSCRIPT

Developers guidelines

March 2010

Java™ Platform, Micro Edition, CLDC – MIDP 2for Sony Ericsson Windows Mobile® 6.5 phones

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Preface

Purpose of this document

This document describes the Java™ ME platform support for Sony Ericsson Java platform JP-WM_SEMC-2.0. Corresponding Developers guidelines for the Sony Ericsson Symbian Java platforms SJP-1 – SJP-3 and SJP-5, Sony Ericsson feature phone Java platforms JP-2 – JP-8, and for the entry Java platform, EJP-1.0 can be found on Sony Ericsson Developer World.

Readers who will benefit from this document include:

• Software developers• Corporate buyers• IT professionals.

• Support engineers• Business decision makers

It is assumed that the reader is familiar with Java.

2 March 2010

This document is published by Sony Ericsson Mobile Communications AB, without any warranty*. Improvements and changes to this text necessitated by typographical errors, inaccuracies of current information or improvements to programs and/or equipment, may be made by Sony Ericsson Mobile Communications AB at any time and without notice. Such changes will, however, be incorporated into new editions of this document. Printed versions are to be regarded as temporary reference copies only.

*All implied warranties, including without limitation the implied warranties of merchantability or fitness for a particular purpose, are excluded. In no event shall Sony Ericsson or its licensors be liable for incidental or consequential damages of any nature, including but not limited to lost profits or commercial loss, arising out of the use of the information in this document.

These Developers guidelines are published by:

Sony Ericsson Mobile Communications AB, SE-221 88 Lund, Sweden

Phone: +46 46 19 40 00Fax: +46 46 19 41 00www.sonyericsson.com/

© Sony Ericsson Mobile Communications AB, 2009. All rights reserved. You are hereby granted a license to download and/or print a copy of this document.Any rights not expressly granted herein are reserved.

2nd revised version (March 2010)Publication number: 1232-1041.2, Rev. B

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Sony Ericsson Developer World

At www.sonyericsson.com/developer, developers find the latest technical documentation and development tools such as phone White papers, Developers guidelines for different technologies, Getting started tutorials, SDKs (Software Development Kits) and tool plugins. The Web site also features news articles, go-to-market advice, moderated discussion forums offering free technical support and a Wiki community sharing expertise and code examples.

For more information about these professional services, go to the Sony Ericsson Developer World Web site.

Document conventions

Products

Sony Ericsson phones are referred to in this document by generic names:

Generic namesSeries

Sony Ericsson phones

X2 Xperia™ X2, Xperia™ X2a

Aspen Sony Ericsson Aspen™ M1i, Sony Ericsson Aspen™ M1a

3 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Terminology and abbreviations

APIApplication Programming Interface

CLDCConnected Limited Device Configuration. A Java ME platform configuration for mobile phones

DRMDigital Rights Management

GSMGlobal System for Mobile Communications. GSM is the world’s most widely used digital mobile phone system, operating in over 100 countries around the world, particularly in Europe and Asia-Pacific

HTTPHyperText Transfer Protocol

IDEIntegrated Development Environment

JSRJava Specification Request

Mascot Capsule®

Mascot Capsule Micro 3D Engine is software that renders 3D objects in real-time on a display screen of an embedded device, portable game unit or mobile phone

MIDPMobile Information Device Profile. A Java ME platform profile connected to the CLDC for mobile phones

MMAPIMobile Media Application Programming Interface

OMAOpen Mobile Alliance

SDKSoftware Development Kit. A collection of tools used to develop application

SMSShort Message Service. Allows messages of up to 160 characters to be sent and received in a phone via the network operator’s message centre

URIUniform Resource Identifier.URIs are short strings that identify online resources: documents, images, downloadable files, services, and electronic mailboxes, for example. URIs use a variety of naming schemes and access methods, such as http, ftp, mailto and telnet, to make resources available

URLUniform Resource Locator. See URI

WAPWireless Application Protocol

WMAWireless Messaging API

WTKWireless Toolkit

4 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Trademarks and acknowledgements

Java and all Java-based marks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.

End-user license agreement for Sun Java platform, Micro Edition.

1 Restrictions: Software is confidential copyrighted information of Sun and title to all copies is retained by Sun and/or its licensors. Customer shall not modify, decompile, disassemble, decrypt, extract, or otherwise reverse engineer Software. Software may not be leased, assigned, or sublicensed, in whole or in part.2 Export Regulations: Software including technical data, is subject to U.S. export control laws, including the U.S. Export Administration Act and its associated regulations, and may be subject to export or import regulations in other countries. Customer agrees to comply strictly with all such regulations and acknowledges that it has the responsibility to obtain licenses to export, re-export, or import Software. Software may not be downloaded, or otherwise exported or re-exported (i) into, or to a national or resident of, Cuba, Iraq, Iran, North Korea, Libya, Sudan, Syria (as such listing may be revised from time to time) or any country to which the U.S. has embargoed goods; or (ii) to anyone on the U.S. Treasury Department's list of Specially Designated Nations or the U.S. Commerce Department's Table of Denial Orders. 3 Restricted Rights: Use, duplication or disclosure by the United States government is subject to the restrictions as set forth in the Rights in Technical Data and Computer Software Clauses in DFARS 252.227-7013(c) (1) and FAR 52.227-19(c) (2) as applicable.

Sony Ericsson Aspen and Xperia are trademarks or registered trademarks of Sony Ericsson Mobile Communications AB.

Windows Mobile is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries.

Nokia is a registered trademark of Nokia Corporation.

Mascot Capsule is a registered trademark of HI Corporation.

Other product and company names mentioned herein may be the trademarks of their respective owners.

Document history

Change history

2009-10-12 Doc. No. 1232-1041.1 First version published on Developer World

2010-02-02 Doc. No. 1232-1041.2 Second version. Information about Aspen phone added

2010-03-17 Doc. No. 1232-1041.2 (Rev. B)

Second, revised version. Links updated

5 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Contents

The Java ME platform .............................................................................................8Sony Ericsson Java platforms ...................................................................................9MIDP 2 support .......................................................................................................10WMA (JSR-120) .....................................................................................................10WMA 2.0 (JSR-205) ................................................................................................10MMAPI (JSR-135) ...................................................................................................11

Audio support ......................................................................................................11Video support ......................................................................................................12

Advanced Multimedia Supplements (JSR-234) ...................................................................................................................13

Image encoding ...................................................................................................13Image post processing ........................................................................................13Camera ................................................................................................................13Radio ...................................................................................................................13Audio effects ........................................................................................................14Audio3d ...............................................................................................................14

3D API (JSR-184) ....................................................................................................14PDA optional packages (JSR-75) ............................................................................14

PIM optional package ..........................................................................................14File Connection optional package .......................................................................15

Java ME Web Services 1.0 (JSR-172) .....................................................................15Mobile Internationalisation API (JSR-238) ...............................................................15Security and Trust API (JSR-177) ............................................................................16Location API (JSR-179) ...........................................................................................16Mobile sensor API (JSR-256) ..................................................................................16Content Handler API 1.0 (JSR-211) ........................................................................17

Java application invokes a Java application .......................................................17Java application invokes a native application: ....................................................17

Project Capuchin .....................................................................................................20PushRegistry&autostart ...........................................................................................20UIActivityMenu ........................................................................................................21

User interaction ...................................................................................................21Bite size code ......................................................................................................21UIActivityMenu class ...........................................................................................22

Java Panel support .................................................................................................22Memory (chunked heap support) ............................................................................22Midlet scaling support .............................................................................................23

Supported attribute in jad/jar ...............................................................................23Supported screen size setting in AMS ................................................................23Scaling rule for different screen size ...................................................................24

Java Native interface ...............................................................................................24JNI sample code ..................................................................................................25

The navigation key ..................................................................................................26Simultaneous key presses ......................................................................................26Security policy for Windows Mobile phones ...........................................................27

Permission settings .............................................................................................27Security Configuration .........................................................................................28

Appendix APhone specifications ................................................................................................30

Screen and memory specifications .........................................................................31

6 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Java specifications ..................................................................................................32Camera specifications .............................................................................................34Font sizes ................................................................................................................34

Key mapping ........................................................................................................35JSR-75 implementation ...........................................................................................37

PIM API ................................................................................................................37JSR-211 MIME content types .................................................................................39The Java Panelizer application ................................................................................43Appendix B

Sony Ericsson SDK for the Java™ ME platform ....................................................44Features ..................................................................................................................45

Installing and updating the SDK ..........................................................................45Integrating the Sony Ericsson SDK for the Java™ ME Platform in NetBeans 6 .....45Integrating the Sony Ericsson SDK for the Java™ ME Platform in Eclipse MTJ ....46

Links and references ................................................................................................47Specifications ......................................................................................................47The Java ME platform ..........................................................................................47

7 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

The Java ME platform

The phones covered in this document support the MIDP 2.1 and CLDC 1.1 specifications.

8 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Sony Ericsson Java platforms

Sony Ericsson uses a platform approach to Java implementation allowing developers to focus on a platform rather than on a variety of different product names.

JP-WM_SEMC = Sony Ericsson Java platform for Windows Mobile®.

Java PlatformPhones

Features Optional features and comments

JP-WM_SEMC-2.0Aspen, X2

JSR-75 (PDA optional packages)

FC, ContactList, TodoList, EventList

JSR-120 (WMA 1.1) SMS Push

JSR-135 (MMAPI 1.2)

JSR-118 (MIDP 2.1)

NokiaUI API 1.1

JSR-184 (Mobile 3D Graphics API 1.1)

Mascot Capsule V4

JSR-185 (JTWI 1.0)

JSR-139 (CLDC 1.1)

JSR-172 (WSA 1.0)

JSR-177 (SATSA 1.0) Crypto package

JSR-179 (LAPI 1.0)

JSR-205 (WMA 2.0) MMS Push

JSR-234 (AMMS 1.0) Image process

JSR-238 (MIAPI 1.0)

JSR-256 (Sensor API 1.2) Accelerometer.Not supported on Aspen

Pushregistry & Autostart

Capuchin

UIActivityMenu

Java Panel

Chunked heap support

Midlet Scaling support

JNI support Java Native Interface

SEMC AMS API 2.0

9 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

MIDP 2 support

All phones covered in this document are compliant with the MIDP 2.1 maintenance release and JTWI 1.0. For a list of protocols, formats, memory size, display size, and so on, supported by the MIDP 2 implementation in the phones, see “Appendix A Phone specifications” on page 30, which contains technical specifications.

The MIDP 2 specification contains a number of optional features of which the following are supported:

• PushRegistry Alarm• PushRegistry SMS• PushRegistry MMS• Signed MIDlets as specified in JTWI 1.0 • TCP and UDP server sockets as specified in MIDP 2• Secure Sockets Layer support: SSL 3.0, TLS 1.0• PlatformRequest supports the http, https and tel schemes among others.

A PlatformRequest invocation for http/https initiates downloading of the given URI, for example, a Java application, an image, and so on. For http/https URIs referencing WAP or Web pages, the Web browser is invoked. The Java application is then left in the background until the phone call/download/Web session is completed, after which it is resumed.

• GameCanvas.getKeyStatus() supports the detection of several simultaneous keys.• TextBox and TextField with input constraints ANY, EMAILADDR and URL support the character set

specified in JTWI 1.0.• PNG images with colour depth of 16 bits per pixel are supported.• The maximum number of application-created threads is limited only by the amount of available

memory.• A TextBox or TextField object with input constraint TextField.PHONENUMBER allows the user to

select a phone number from the phonebook, as specified in JTWI.

WMA (JSR-120)

The Wireless Messaging API v 1.1 (JSR-120) is supported. GSM SMS is supported in all phones covered in this document. MIDP 2.0 security has been added to the Open connection, Send and Receive functions, as specified in WMA 1.1, http://www.jcp.org/en/jsr/detail?id=120.

WMA 2.0 (JSR-205)

The Wireless Messaging API 2.0 is an extension and enhancement of WMA (JSR-120). GSM SMS and MMS are supported.

WMA 2.0 is based on the Generic Connection Framework (GCF), which is defined in the Connected Limited Device Configuration (CLDC) 1.0 specification. The package javax.microedition.io defines the framework and supports input/output and networking functionality in Java ME profiles.

10 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

The JSR-205 specification can be downloaded from http://www.jcp.org/en/jsr/detail?id=205.

MMAPI (JSR-135)

The MMAPI support in the phones in this document provides access to audio and video playback, as well as image capture with the phone camera. For a list of supported data formats, see “Java specifications” on page 32. The JSR-135 specification can be downloaded from http://www.jcp.org/en/jsr/detail?id=135.

Players can be created from:

• Java streams• DataSources• URIs with “http://”, “https://”, “file://”, “rtsp://”, “capture://video”, “capture://audio”, “device://midi” or

“device://tone”. Note: Real time streaming (rtsp) is not supported on Aspen phones.System.getproperty(....) calls can be used to retrieve supported parameters/values in specific phones.

Audio support

See also “Java specifications” on page 32.

The number of simultaneously started players is limited only by available memory. Phones also support more advanced mixing. The number of mixing players is limited only by phone hardware. One player can play an audio file in parallel with another player which also supports one of the formats above. But players cannot play TONE files or a TONE file and a MIDI file in parallel.

11 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

The following table describes the media type mapping with supported controls:

Video support

See also “Java specifications” on page 32.

Only one video player can exist at a particular time. The video player can display its contents in a Canvas or in an Item on a Form.

The snapshot functionality is only supported for taking a picture with the built-in camera. Access to the camera snapshot functionality follows the security policy specified in JTWI.

Video recordings from the built-in camera are supported.

The following table describes the media type mapping with supported controls:

MetaDataControl StopTimeControl ToneControl VolumeControl RecordControl

WAV X X X

MIDI X X X

TONE X X X

AMR X X

AWB X X

AAC X X

MP3 X X

M4A X X

GUIControl RecordControl StopTimeControl VideoControl VolumeControl

MP4 X X X X

3GP X X X X

3GP2 X X X X

AMR X

12 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Advanced Multimedia Supplements (JSR-234)

Advanced Multimedia Supplements (AMMS) builds on the framework already established in the Mobile Media API (MMAPI, JSR-135). AMMS adds many new controls and extensions to the MMAPI framework.

The full JSR-234 specification can be downloaded from http://www.jcp.org/en/jsr/detail?id=234.

Image encoding

• javax.microedition.amms.MediaProcessorMediaProcessor can be created for JPEG and raw images.

• javax.microedition.amms.control.ImageFormatControlThe JPEG format is supported.

Image post processing

• javax.microedition.amms.control.imageeffect.ImageEffectControlImageEffectControl is supported for the MediaProcessor

• javax.microedition.amms.control.imageeffect.ImageTransformControlImageTransformControl is supported for the MediaProcessor

• javax.microedition.amms.control.imageeffect.OverlayControlOverlayControl is supported for the MediaProcessor

Camera

Not supported.

Radio

Not supported.

13 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Audio effects

Not supported.

Audio3d

Not supported.

3D API (JSR-184)

The phones in this document support Mobile 3D Graphics API 1.1 for Java ME, Mascot Capsule ver. 4, (JSR-184).

For more information on the implementation of the 3D API, see the Developers guidelines “3D graphics with Java ME”, available at www.sonyericsson.com/developer/java.

PDA optional packages (JSR-75)

The PDA optional packages for Java ME (JSR-75) consist of two separate APIs, one for accessing PIM data and one for file system access.

PIM optional package

The PIM (Personal Information Management) API is standardised in the JSR-75 specification, which can be downloaded from http://www.jcp.org/en/jsr/detail?id=75.

In Sony Ericsson Windows Mobile 6.5 phones the PIM API handles:

• Contacts (ContactList)• Calendar (EventList)• Tasks (ToDoList).

For more details, see “JSR-75 implementation” on page 37.

14 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

File Connection optional package

The File Connection API is standardised in the JSR-75 specification, which can be downloaded from http://www.jcp.org/en/jsr/detail?id=75.

In general, Java applications can access the same folders, subfolders and files as the built-in File manager application, both in phone internal memory and on an inserted memory card. The following folders and all contained subfolders and files are accessible via the API:

• <file:///C:/> (internal memory file root)• <file:///E:/> (memory card file root)

Java ME Web Services 1.0 (JSR-172)

The Java ME Web Services 1.0 APIs (JSR-172) are supported and contain implementations of the Java API for XML-based RPC (JAX-RPC) and XML-parsing (WSA/JAXP).

The JSR-172 contains two independent, optional packages, both supported:

• Java ME XML Parser (WSA/JAXP)• Java ME RPC (WSA/JAXRPC), which facilitates access to XML based Web services from CDC and

CLDC based profiles.

The complete JSR-172 specification can be downloaded from the Java Community Pages, http://www.jcp.org/en/jsr/detail?id=172

Mobile Internationalisation API (JSR-238)

The Mobile Internationalisation API is a Java ME Optional Package containing an application program interface that allows MIDP application developers to internationalise their applications.

Internationalisation is a prerequisite to localisation, both very important in multilingual software development. The API provides the locale-specific formatting of dates, times, numbers (including percentages) and currency amounts. It is also possible to construct messages that have a variable number of ordered parameters.

The API also defines a mechanism to retrieve application-specific and device-specific resources, and provides services for the locale-specific collation (sorting) of strings.

All classes in this API are in a single package:

• javax.microedition.global

The complete JSR-238 specification can be downloaded from the Java Community Pages, http://www.jcp.org/en/jsr/detail?id=238

15 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Security and Trust API (JSR-177)

The Security and Trust Services API (JSR-177) Crypto Optional Package is implemented.

In the SATSA optional package, basic support for accessing public keys is provided, computing digests, and verifying digital signatures. It also provides basic support for encryption and decryption of data, and the encryption and decryption of data for IAIK. The complete JSR-177 specification can be downloaded from the Java Community Pages, http://www.jcp.org/en/jsr/detail?id=177

Location API (JSR-179)

The Location API v1.0 (JSR-179) is supported. It is a Java ME Optional Package.

In Sony Ericsson Windows Mobile 6.5 phones, the following LAPI features are implemented:

• LocationProvider• Landmark (only Java) • ProximityListener

In X2 phones, the following LAPI features are not implemented:

• Orientation (not implemented on Windows Mobile)• Native Landmark Store

For this feature, Java application cannot share the land mark store with native applications. Videlicet, the native application, stores map information when it accesses some maps by GPS, Java cannot retrieve map information from the native landmark store, and the native application cannot get map information from the Java landmark store, stored by a Java application.

Mobile sensor API (JSR-256)

Note: JSR-256 is not supported on Aspen phones.

JSR-256, Mobile Sensor API, allows Java ME application developers to fetch data easily and uniformly from sensors. A sensor is any measurement data source. In the Sony Ericsson X2 phone, JSR-256 supports reading data from the built-in accelerometer sensor. The API provides means to monitor measured data.

The current API implementation in the Sony Ericsson X2 phone does not provide any methods to control a sensor; it only provides methods for receiving information from a sensor.

This API has only limited compile/runtime support in the SDK, for example, the SensorManager class, findSensors(...) method returns an empty array of SensorInfo[].

The classes and interfaces of this API are defined in the package javax.microedition.sensor.

16 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

The complete JSR-256 specification can be downloaded from the Java Community Pages, http://www.jcp.org/en/jsr/detail?id=256

Content Handler API 1.0 (JSR-211)

The Content Handler API (CHAPI) v1.0 (JSR-211) is supported. The API defines a communication model between applications (either Java/Java ME or native applications), by letting developers specify MIDlets as the content handlers for one or more specific file types. Using this execution model, a given MIDlet can register itself into the operating system of the device to become the default application responsible for manipulating files of a specific MIME type. For example, it is possible to create a MIDlet to edit/display .png images and register it as the default handler for the image/png MIME type. From a successful registration onward, any requests for visualisation of a .png file automatically activates the MIDlet (regardless of whether that request was initiated by a Java application or an application written in some other language).The complete JSR-211 specification can be downloaded from the Java Community Pages, http://www.jcp.org/en/jsr/detail?id=211

The CHAPI 1.0 specification contains a number of optional features of which the following are supported:

Java application invokes a Java application

To enable this feature, the MIDlet must register itself for a specific scheme.

Example on static registration for the scheme ".txt" in the jad file of the sample MIDlet ShowLogo:

MicroEdition-Handler-1: com.jbed.microedition.chapi.test.mvm.TextCHandler, text/plain, .txt, open,MicroEdition-Handler-1-ID: com.jbed.microedition.chapi.test.mvm.TextCHandler

Then the Java AMS (Application Management System) can find the text handler and invoke it to handle the content type .txt file.

Java application invokes a native application:

This feature needs a native application that can handle the content types and the java AMS (Application Management System) will find the native handler via native AMS (Application Management System). For example, Java can get the handler from the native registry via a content URL (for example, file:///c:/My Documents/Alouette.mid) or a MIME type (text/html, image/gif, and so on), then the Java application can invoke the native application to handle it successfully. CHAPI can support MIME content types as described in “JSR-211 MIME content types” on page 39.

Sample code for invoked native application with target URL:Registry registry = Registry.getRegistry(CALLER_CLASSNAME);String url = "file:///c:/my document/my pictures/grass.jpg"; // url with file extension so that jbed can find the handler from WM register table

17 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Invocation invoc = new Invocation(url);boolean mustExit = registry.invoke(invoc);

Result: WM launches the native application “Pictures&Videos” to open the image "\my documents\my pictures\grass.jpg" automatically.

Sample code for invoked native application directly with arguments:Registry registry = Registry.getRegistry(CALLER_CLASSNAME);String url = "file:///c:/Windows/iexplore.exe"; // the application's path in WMString args[] = { "www.sonyericsson.com" }; // parameter for the native appInvocation invoc = new Invocation(url);invoc.setArgs(args);boolean mustExit = registry.invoke(invoc);

Result: WM launches Internet Explorer and shows www.google.com. Several parameters can be put here with whitespace as separator.

Sample code for invoked native application with URL and content type:Registry registry = Registry.getRegistry(CALLER_CLASSNAME);String url = "www.sonyericsson.com"; //url without extension, so we need also put the content type here.String contentTtype = "http"; // content type for the urlInvocation invoc = new Invocation(url);invoc.setType(contentTtype);boolean mustExit = registry.invoke(invoc);

Result: WM launches Internet Explorer and shows www.google.com.

Native application invokes a Java application:Jbed registers the java content handler into Windows Mobile registry table so that the Java content handler can be automatically invoked by Windows Mobile according to the MIME Type and default action.

Example: a MIDlet with Content Handler id "example.content.PNGHandler", registered suffix ".png" and content type "image/png". When the end user clicks any png file in Windows Mobile File Explorer, the example.content.PNGHandler is automatically launched to open this png file.

Also a Windows Mobile programmer can manually invoke this content handler to open the png file using the following command line format:

\windows\jbed.exe -contentHandler contententHandlerID [-contentURL anyurl] |[-contentArgs argumens]

The arguments -contentHandler and contentHandlerID are mandatory for CHAPI invocation, the -contentURL or -contentArgs must be available after -contentHandler. Also all three of these arguments can be used together.

Example for transfer url from native to java:

\windows\jbed.exe -contentHandler example.content.PNGHandler -contentURL "\png file path\anypng.png"

The CHAPI MIDlet gets the URL path via method invocation.getURL() and the URL is automatically supplied with pre-suffix file:///, so the result is "file:///png file path/anypng.png".

18 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Example for transfer arguments from native to java:

\windows\jbed.exe -contentHandler example.contentPNGHandler -contentArgs "arguments goto success"

The CHAPI MIDlet gets the arguments as a string array with value {"arguments", "goto", "success"}.

Example for transfer url and arguments from native to java:

\windows\jbed.exe -contentHandler example.contentPNGHandler -contentURL "\png file path\anypng.png" - contentArgs "arguments goto success"

The CHAPI MIDlet gets the URL via method getURL() and gets the arguments via method getArgs().

Sample C source code to call the Java Content Handler:

const WCHAR * JAVA_EXE_PATH = L"\\Windows\\jbed.exe";const WCHAR * CHAPI_PARAM = L" -contentHandler example.content.PNGHandler -contentURL \path\any.png";SHELLEXECUTEINFO info;memset(&info, 0, sizeof(info));info.cbSize = sizeof(info);info.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS; info.lpFile = JAVA_EXE_PATH;info.lpParameters = CHAPI_PARAM;info.nShow = SW_SHOWNORMAL;ShellExecuteEx(&info);

In PNGHandler, the developer can useInvocation.getURL get string "file:///path/any.png".

Dynamic registry:

MIDlets can also be registered dynamically. The sample code below registers a MIDlet as the content handler for image/png files and declares that the MIDlet will be responsible for handling opening requests (ContentHandler.ACTION_OPEN) for that file type. The code calls the Registry.register() method to perform the registration. The complementary Registry.unregister() method makes an application, previously defined as a content handler, unregistered. Content handlers are unregistered automatically when their corresponding MIDlets are removed (uninstalled) from the device.

try {// Create a content handler instance for the// Generic PNG HandlerString[] chTypes = { "image/png" };String[] chSuffixes = { ".png" };String[] chActions = { ContentHandler.ACTION_OPEN };String chClassname = "example.content.PNGHandler";ContentHandler handler =Registry.register(chClassname, chTypes, chSuffixes, chActions);

} catch (ContentHandlerException ex) {// Handle exception}

19 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Project Capuchin

Project Capuchin is a Java API defining a bridge between Java ME and Adobe Flash Lite technologies. This API makes it possible to use Flash Lite as the front end and Java ME as the back end of applications. Capuchin is the base for great looking applications where the UI presentation is designed in Flash Lite while the data logic is provided by Java code. Data transmission is enabled both ways, from Java ME to Flash Lite and from Flash Lite to Java ME.

Project Capuchin enables faster UI development and easier collaboration between graphical designers and code developers. Once all interfaces between the presentation and service layers have been defined, UI designers can develop and test the presentation layer in the Flash environment independent of the Java development and testing of the service layer.

Project Capuchin makes all services available to Java ME also available to Flash, by extending the ActionScript API in a structured manner.

Project Capuchin improves Flash Lite content security, distribution and installation by embedding Flash Lite content as a resource in MIDlet suites (.jar).

For more information on how to use Project Capuchin in Java ME, refer to http://developer.sonyericsson.com/projectcapuchin

PushRegistry&autostart

Autostart is a Java extension feature of Sony Ericsson. This feature can be used to let the MIDlet autostart when the phone powers on or the JVM starts. This can be implemented in two ways.

Static:

In jad: MIDlet-Push-1: autostart://:, AutoStartStatic, *

Dynamic:

PushRegistry.registerConnection("autostart://:", "AutoStartDyn", "*"); PushRegistry.unregisterConnection("autostart://:")

* AutoStartStatic, AutoStartDyn are the midlet names.

The demo is found in: http://developer.sonyericsson.com/cws/download/1/708/151/1260889879/87802-autostart.zip

20 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

UIActivityMenu

User interaction

When new events are added to the Activity Menu, the Activity Menu pops up on top of the display unless the camera, video-player, video-call, and so on, application is running in the foreground.

When the user selects an event, the underlying application is brought to focus and an event regarding the particular event is delivered to the Java application.

The user can delete events from the Activity Menu, in which case the application is not notified.

Bite size code

public RightNow() { UIActivityMenu.getInstance(this).setEventListener(new UIEventListener() { public void eventAction(int id) { text = "Action Id: " + id; d.repaint(); } }); try { icon = Image.createImage("/X.png"); } catch (Throwable e) {} } public void startApp() { Display.getDisplay(this).setCurrent(d); }

public void commandAction(Command c, Displayable d) {

Display.getDisplay(this).setCurrent(null); if (t == null) { t = new Timer(); t.schedule(new TimerTask() { public void run() { UIActivityMenu.getInstance(RightNow.this).addEvent("Title", "Description", null, icon); } }, 1000, 8000); } }

21 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

UIActivityMenu class

public class UIActivityMenu {public static synchronized UIActivityMenu getInstance(MIDlet m)public void setEventListener(UIEventListener el)public int addEvent(String title, Image icon)public int addEvent(String title, String desc, Image titleIcon, Image descIcon)}

Java Panel support

The Java Panelizer application enables third-party Java application developers to package a Java MIDlet for use as a Panel application on a Sony Ericsson Windows Mobile phone.

The application creates a "CAB" installation file for the phone, containing the following:

• A Java MIDlet content file (JAR/JAD) to be run in a Panel window on the phone.

• A set of four bitmap (BMP or PNG) files, to provide the screenshots to be used by the Panel menu system. The Panel menu system requires four screenshots, for portrait, landscape, large portrait, and large landscape respectively.

• A mandatory DLL library file, setup.dll, to provide any extended functionality during the installation.

• A name and an optional description, to be used by and displayed in the Panel menu system of the phone.

For more detailed information about the Java Panelizer, see “The Java Panelizer application” on page 43.

Memory (chunked heap support)

Sony Ericsson phones utilise a number of different memory areas for user interface features, and for images in particular. The total amount of memory available varies depending on how much of this memory other native phone applications have currently allocated. If needed, and if memory is available, the Java heap grows dynamically up to about 8 MB.

22 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Midlet scaling support

Many MIDlets are designed to fit low resolution screens, and fill only a tiny part of QVGA/VGA/WVGA screens in later phones. This makes the MIDlet harder to see and use. JVM adds a feature to scale/zoom to larger size, called JVM MIDlet scaling support. This feature can only be used for Canvas and GameCanvas because it does not make sense for a Non-Canvas midlet. Also pointer coordinates and font heights are adjusted after scaling has been applied.

Supported attribute in jad/jar

JVM checks the following attribute in Jad/Jar files defined by MIDP3, Nokia and SonyEricsson:

• MIDlet-Maximum-Canvas-Size: <width, height>• MIDlet-Minimum-Canvas-Size: <width, height>• SEMC-Screen-Size: <width, height>• Nokia-MIDlet-Original-Display-Size: <width, height>

Example:

Nokia-MIDlet-Original-Display-Size: 176,208

If one of the above parameters has been found then the corresponding option in the AMS menu is set.

Supported screen size setting in AMS

JVM support the following screen size settings in AMS > Menu > Action > Screen size:

• Default (480x800)• 240x320• 176x220• 176x208• 128x160• 128x128

23 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Scaling rule for different screen size

Java Native interface

Sony Ericsson phones provide Java Native Interface (JNI) support for operator and manufacturer domain MIDlet development. The JNI implementation is fully compatible with J2SE 1.4.

NativeLib Class:public class NativeLib {

/*** loads a native library extension from a MIDlet resource** @param fromClass . the Class calling this API* @param name native library name of the library to load, NO PATH in

the name, the native library must exist in the root directory of midlet* @return 0 if library was found and loaded OK* -1 named resource not found* -2 named resource found, but could not be installed* -3 named resource installed, but could not be loaded* -4 the MIDlet does not have permission to load libraries*/public synchronized static int loadMIDletExtension(Class fromClass,

String name);}

Notes:• Using this feature requires the MIDlet to be signed in Operator or Manufacturer domain.• Required permission in jad file: com.jbed.runtime.NativeLib.loadMIDletExtension.

Example: MIDlet-Permissions-Opt: com.jbed.runtime.NativeLib.loadMIDletExtension.• The library name passed to the loadMIDletExtension() must use only alphanumeric characters.• The library name passed to the loadMIDletExtension() must not include the .dll suffix.• The dll must be at the top level in the jar.• The dll filename must end with the .dll suffix.

Screen size Scaling times (Portrait) Scaling times (Landscape)

Default (480x800) N/A N/A

240x320 2 1.5

176x220 2 2

176x208 2 2

128x160 3 3

128x128 3 4

24 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

JNI sample code

The sample code below demonstrate JNI usage in MIDlets. For more information about JNI usage, go to www.java.sun.com.

Sample code on Java side:import com.jbed.runtime.NativeLib;public class JNITest extends MIDlet {

public JNITest(){int res = NativeLib.loadMIDletExtension(this.getClass(), "JNITest");

}protected void destroyApp(boolean arg0) throws MIDletStateChangeException{

}protected void pauseApp() {}protected void startApp() throws MIDletStateChangeException { String str = GetHelloMessage("Hello From Java!");}private static native String GetHelloMessage(String string);}

Sample code in Native:#include "stdafx.h"#include <windows.h>#include <commctrl.h>#include "jni.h"#include <stdio.h>#include <string.h>#ifdef __cplusplusextern "C" {#endifBOOL APIENTRY DllMain( HANDLE hModule,

DWORD ul_reason_for_call, LPVOID lpReserved

){

return TRUE;}/* * Class: JNITest * Method: GetHelloMessage * Signature: (Ljava/lang/String;)Ljava/lang/String; */JNIEXPORT jstring JNICALL Java_JNITest_GetHelloMessage(JNIEnv *env, jclass clazz, jstring str){

jboolean b = true;char s[80];memset(s, 0, sizeof(s));strcpy(s ,(char*)env->GetStringUTFChars(str, &b));printf("%s\n", s);env->ReleaseStringUTFChars(str , NULL);

25 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

return env->NewStringUTF("Hello from Native world!");}#ifdef __cplusplus}#endif

The navigation key

The phones in this document detect navigation key actions in the following manner:

• Two adjacent directions are simultaneously detected. If the navigation key is pressed in one of the four main directions, up, down, left or right, one event is delivered to the application.

• Navigational changes are detected directly without having to go back to neutral position.

Simultaneous key presses

Support for simultaneous key presses enhances gaming experience. For example, a user playing a game can move around on the screen and shoot at the same time.

Most Sony Ericsson phones support simultaneous key presses. However, a MIDP developer can not take for granted that a certain phone model supports simultaneous key presses in all possible combinations. Games and other applications should always be tested with the actual targeted hardware. Hardware emulators does not necessarily emulate simultaneous key presses properly.

In general, when two keys are pressed at the same time, the proper events are delivered to the application. When three or more keys are pressed in some combinations, extra key presses may be detected. In other combinations, a third key is not detected at all. The general approach when more than two keys need to be detected at the same time, is to map the game keys (Fire, game A, game B, and so on) to actions that might occur at the same time as two or more other key presses.

More specific information for the simultaneous key press functions can be found in Appendix A, “Key mapping” on page 35.

26 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Security policy for Windows Mobile phones

The phones described in this document comply with the JSR185 Java Technology for the Wireless Industry (JTWI) specification and MIDP 2 recommended security policy. For a detailed description of the installation and security rules, see Chapter 7, Security Policy for GSM/UMTS Compliant Devices of the JSR-185 specification (http://www.jcp.org/en/jsr/detail?id=185). A number of APIs are categorised as “restricted”. Usage can result in costs for the user (traffic charges), inappropriate use may potentially affect the user data integrity or cause disturbance to other parties.

Permission settings

The following table lists definitions of permission settings:

Setting Definition Screen description

Not allowed Permission can never be granted. The application is not allowed access to this function and the user is unable to modify this setting

NO

Oneshot Permission requires user acceptance for each access Always ask

Session Permission requires user acceptance once for the first access each time the application is run

Ask Once

Blanket Permission requires user acceptance only once the first time the application is run

Never ask

Allow Permission does not require user acceptance, no user interaction

27 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Security Configuration

Functionality/Domain Third party protection domain (Untrusted domain)

Identified third party protection domain (Trusted 3rd party domain)

Network access NO Oneshot Session

NO Oneshot SessionBlanket

javax.microedition.io.Connector.httpjavax.microedition.io.Connector.httpsjavax.microedition.io.Connector.datagram javax.microedition.io.Connector.datagramreceiver datagram server (w/o host) javax.microedition.io.Connector.socket javax.microedition.io.Connector.serversocket server socket (w/o host) javax.microedition.io.Connector.ssl ssl

Application auto start NO Oneshot Session

NO Oneshot SessionBlanket

javax.microedition.io.PushRegistry

Messaging NOOneshot

NOOneshotSessionBlanket

javax.wireless.messaging.sms.send javax.wireless.messaging.sms.receive javax.microedition.io.Connector.smsjavax.wireless.messaging.mms.sendjavax.wireless.messaging.mms.receivejavax.microedition.io.Connector.mms

PIM and File Connection APIs(Read/Write user data)

NOOneshotSessionBlanket

NOOneshotSessionBlanketjavax.microedition.pim.ContactList.read Blanket

javax.microedition.pim.ContactList.writejavax.microedition.pim.EventList.readjavax.microedition.pim.EventList.writejavax.microedition.pim.ToDoList.readjavax.microedition.pim.ToDoList.writejavax.microedition.io.Connector.file.readjavax.microedition.io.Connector.file.write

Local connectivity NOOneshotSessionBlanket

NOOneshotSessionBlanket

Multimedia NOOneshotSession

NOOneshotSessionBlanket

28 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

The security domain is determined at installation as follows:

• If the MIDlet suite is unsigned, then it will be installed in the "Third party protection domain".

• If the MIDlet suite was signed using a certificate granted by a trusted third party such as GeoTrust or Thawte, then it will be installed in the "Identified third party protection domain". Operators maintain control of their certification process.

• A signed MIDlet suite is not installed if certificate verification fails, for example, when a MIDlet suite, signed by one operator, is attempted to install on a phone issued by another operator. In other words, operator signatures are not generic, but are specific to phones provided by each individual operator.

The digital certificate embedded in the JAD and the signed JAR file are verified for authenticity and date validity at install time according to chapter 4 of the JSR-118 specification (http://www.jcp.org/en/jsr/detail?id=118). This assures data integrity and vendor identity.

Platform request NOOneshot

NOOneshot

Location NOOneshotSession

NOOneshotSessionBlanket

Landmark NOOneshotSession

NOOneshotSessionBlanket

Functionality/Domain Third party protection domain (Untrusted domain)

Identified third party protection domain (Trusted 3rd party domain)

29 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Appendix APhone specifications

In this appendix the technical specifications are listed for the phones covered in this Developers guideline.

Note: market/customer variations in the specifications may exist.

30 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Screen and memory specifications

Screen sizes are specified as Width x Height (pixels).

Specification/Phone X2 Aspen

Screen

Screen size 800x480 320x240

Fullscreen canvas size 800x480 320x240

Non fullscreen canvas size 696x480

Pixel ratio (H:W) 1:1

Colour depth 65,536 (16-bit)

Transparency Full (8-bit) alpha blending

Memory

Max. RMS size Limited only by the amount of available free storage

Memory, storage Up to 110 MB Up to 100 MB

The amount of memory available for Java applications depends on the free amount of internal memory in the phone. Other contents, such as pictures, video clips and themes, use the same memory pool

Java heap size 4 MB – 32 MB (dynamic, depending on available memory)

Max. JAR size Unlimited

Native video RAM available to Java

Uses the system/OS memory

31 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Java specifications

The table lists the Java characteristics of the phones covered in this document.

Characteristic Support Comments

CLDC version 1.1

MIDP version 2.1

Supported image formats:GIF87a, GIF89a, JPEG, PNG v 1.0 (colour depth 1, 2, 4, 8, 16 bits per pixel), BMP v 3.x, WBMP level 0

Networking: secure sockets, http 1.1, https. TLS 1.0 is also supported

See also “MIDP 2 support” on page 10

PDA optional pack-ages (JSR-75)

Version 1.0

PIM API, supported package:• Javax.microedition.pimPIM API, supported classes/interfaces:• Contact• Event• ToDo• Serialisation methods on PIM items• Serialisation of PIM items according to

vCard 2.1/vCalendar 1.0.

File connection API, supported package:• javax.microedition.io.file.

See also “PDA optional pack-ages (JSR-75)” on page 14 and “JSR-75 implementation” on page 37

WMA (JSR-120) 1.1 - GSM SMS See also “WMA (JSR-120)” on page 10

WMA 2.0 (JSR-205) GSM SMSMMS

See also “WMA 2.0 (JSR-205)” on page 10

JTWI (JSR-185) compliant

Yes, Release 1

32 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

MMAPI (JSR-135) 1.2

Supported Audio Content types, playback:• audio/midi - MIDI (GM, GML and SP-MIDI)• audio/x-wav - WAV (PCM)• audio/x-tone-seq - JSR-135 tone sequence• audio/mpeg - MP3 (MPEG-1 layer 3, MPEG-2

layer 3, MPEG 2.5 layer 3)• audio/amr - AMR• audio/mp4a-latm - 3GP (MPEG-4 AAC LC)Supported Audio formats, recording:• AMR

See also “MMAPI (JSR-135)” on page 11

Supported Video Content types, playback:• video/mp4v• video/3gp

Supported Image (Camera) Content types:• image/jpeg - JPEG

See also “Camera specifica-tions” on page 34

AMMS (JSR-234) Extended image handling functionality

Java ME Web Serv-ices (JSR-172)

Version 1.0

Supported packages:• XML parsing• XML Web services

See also “Java ME Web Serv-ices 1.0 (JSR-172)” on page 15

Mobile Internationali-sation API (JSR-238)

Security and Trust API (JSR-177)

Supported packages:• javax.crypto• javax.crypto.spec

OTA Recommended practice

Yes, MIDP 2 compliant

Debug interface KDWP

Numeric keys QWERTY full keyboard

4-way directional key with select

Yes (navigation key)

Signed MIDlets Yes

TCP Sockets Yes

UDP Sockets Yes

Java 3D Mascot Capsule Micro3D version 4, JSR-184 ver 1.1

NokiaUI API Version 1.1

Multitasking VM Yes

Characteristic Support Comments

33 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Camera specifications

Players can be created from: "capture://video"

Controls of video recording: record control.

Supported size of video recordings: 320x240 px.

Controls of camera snapshot: video control.

Supported size of camera snapshot: 320x240 px.

Font sizes

A font is specified by requesting a style, size and face. All style, size and face attributes are supported.

Note: Font attributes are only available for Java in the low-level UI (Canvas or GameCanvas objects).

Font heights and widths in pixels (including line spacing) are listed below:

Font face Size SMALL Size MEDIUM Size LARGE

MONOSPACE“Tahoma”

height 29width 17

height 32width 17

height 39width 17

MONOSPACE“Courier New”

height 29width 17

height 32width 17

height 39width 17

PROPORTIONAL“Tahoma”

height 31 height 35 height 42

SYSTEM“Tahoma”

height 31 height 35 height 42

INPUT TEXT“Tahoma”

One size: Height 35

STATIC TEXT“Tahoma”

One size: Height 35

34 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Key mapping

Sony Ericsson phones support the keyPressed( ), keyReleased( ), and keyRepeated( ) event delivery methods in class Canvas.

Key Constant value MIDP key code Game action

4-way Up key -1 MIDP_KEY_UP UP

4-way Down key -2 MIDP_KEY_DOWN DOWN

4-way Left key -3 MIDP_KEY_LEFT LEFT

4-way Right key -4 MIDP_KEY_RIGHT RIGHT

4-way Select Press key -5 MIDP_KEY_SELECT FIRE

* 42 KEY_STAR

# 35 KEY_POUND

0 48 KEY_NUM0

1 49 KEY_NUM1 GAME_A

2 50 KEY_NUM2 UP

3 51 KEY_NUM3 GAME_B

4 52 KEY_NUM4 LEFT

5 53 KEY_NUM5 FIRE

6 54 KEY_NUM6 RIGHT

7 55 KEY_NUM7 GAME_C

8 56 KEY_NUM8 DOWN

9 57 KEY_NUM9 GAME_D

Ctrl key -6 MIDP_KEY_SOFT1

au key -7 MIDP_KEY_SOFT2

C key (Clear) -8 MIDP_KEY_CLEAR

Send key -10 MIDP_KEY_SEND

y 121 GAME_A

Y 89 GAME_A

u 117 UP

U 85 UP

i 105 GAME_B

I 73 GAME_B

h 104 LEFT

35 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Note: Simultaneous keypress support: Two or more keys pressed at the same time are properly detected. When more than one key is pressed, the keyRepeated() event is only sent on the last key.

H 72 LEFT

j 106 FIRE

J 74 FIRE

k 107 RIGHT

K 75 RIGHT

n 110 GAME_C

N 78 GAME_C

m 109 DOWN

M 77 DOWN

. 44 GAME_D

F 70 FIRE

f 102 FIRE

= 61 FIRE

Key Constant value MIDP key code Game action

36 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

JSR-75 implementation

This section specifies supported JSR-75 features.

PIM API

The PIM API supports the following PIM lists:

• Contacts (ContactList)• Calendar (EventList)• Tasks (ToDoList).

Actual names of lists and other labels depend on locale.

ContactsSupported Java PIM fields:

• UID (LUID)• NAME. Supported array elements:

• NAME_FAMILY• NAME_GIVEN• NAME_OTHER• NAME_PREFIX• NAME_SUFFIX

• ADDR. Supported attributes:• ATTR_HOME• ATTR_WORK• ATTR_OTHER

• ADDR. Supported array elements:• ADDR_STREET (Street)• ADDR_LOCALITY (City)• ADDR_REGION (State)• ADDR_POSTALCODE (Zip code)• ADDR_COUNTRY (Country)

• TITLE• ORG (Company)• EMAIL. Supporte attributes:

• ATTR_HOME• ATTR_WORK• ATTR_PREF

• URL• NOTE (Freetext)• TEL. Supported attributes:

• ATTR_HOME• ATTR_WORK• ATTR_MOBILE• ATTR_FAX• ATTR_ASST• ATTR_PAGER• ATTR_AUTO

37 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

• ATTR_OTHER• ATTR_PREFERRED

• PHOTO• BIRTHDAY• FORMATTED_NAME

Unsupported Java standard fields• CLASS• FORMATTED_ADDR• NICKNAME (Requires vCard 3.0)• PUBLIC_KEY• PUBLIC_KEY_STRING• REVISION.

CalendarSupported Java PIM fields:

• UID• SUMMARY• LOCATION• NOTE• END• START• ALARM• CLASS

Unsupported Java standard fields• REVISION• GEO

TasksSupported Java PIM fields:

• UID• SUMMARY• NOTE• DUE• COMPLETION_DATE• COMPLETED• PRIORITY

Unsupported Java standard fields• CLASS• REVISION

38 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

JSR-211 MIME content types

Content Type Suffix

application/ java-archive .jar

msword .doc

pdf .pdf

sdp .sdp

vnd.google.gmm .gmml

vnd.google-earth.kml+xml .kml

vdn.gogle-earth.kmz .kmz

vnd.ms-excel .xls

vnd.oma.add+xml

vnd.oma.drm.content

vnd.oma.drm.message

vnd.oma.drm.rights+wbxml

vnd.oma.drm.rights+xml

vnd.openxmlformats-officedocument.spread-sheetml.sheet

.xlsx

vnd.openxmlformats-officedocument.spread-sheetml.template

.xltx

vnd.wap.wmlc .wmlc

vnd.wap.xhtml+xml .xhtml

xhtml+xml .xhtml

x-javascript .js

x-msdownload .exe

x-msexcel .xls

39 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

audio/ 3gpp .3gp

acc .acc

aiff .aiff

amr .amr

amr-wb .awb

basic .au

m4a .m4a

mid .mid

midi .mid

mp3 .mp3

mp3d .mp3d

mp4 .mp4

MP4A-LATM .mp4a

mpeg .mp3

mpeg3 .mp3

mpg .mp3

mpg3 .mp3

qcp .qcp

sp-midi .mid

vnd.qcelp .qcp

wav .wav

x-aiff .aiff

x-midi .mid

x-mp3 .mp3

x-mpeg .mp3

x-mpeg3 .mp3

x-mpg .mp3

x-mpg3 .mp3

x-ms-wax .wmwebasx

x-ms-wma .wmwebasf

x-wav .wav

Content Type Suffix

40 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

image/ bitmap .bmp

bmp .bmp

gif .gif

jpeg .jpg

jpg .jpg

pjpeg .jpg

png .png

vnd.wap.wbmp .wbmp

wbmp .wbmp

xbm .xbm

x-icon .ico

x-MS-bmp .bmp

x-png .png

x-xbitmap .xbm

text/ css .css

html .htm

plain .txt

vnd.wap.wml .wml

x-ical .ics

xml .xml

xsl .xsl

x-vcal .vcs

x-vcard .vcf

Content Type Suffix

41 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

video/ 3g2 .3g2

3gpp .3gp

3gpp2 .3g2

avi .avi

m4v .m4v

mp4 .mp4

msvideo .avi

x-ms-asf wmwebasx

x-ms-asx .wmwebasx

x-ms-avi .avi

x-ms-nsc .wmwebnsc

x-msvideo .avi

x-ms-wm .wmwebasf

x-ms-wmp .wmwebasf

x-ms-wmv .wmwebasf

x-ms-wmx .wmwebasx

x-ms-wvx .wmwebasx

x-mid/ midi .mid

x-midi/ midi .mid

Content Type Suffix

42 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

The Java Panelizer application

The Java Panelizer enables Java developers to create a CAB installation file for the Windows Mobile phone, containing a MIDlet and all necessary components for deploying the MIDlet as a Panel application.

The Java Panelizer application can be downloaded from www.sonyericsson.com/developer.

43 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Appendix BSony Ericsson SDK for the Java™ ME platform

This appendix contains information about the Sony Ericsson SDK for the Java™ ME platform and its integration in developer tools.

44 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

Features

The Sony Ericsson SDK for the Java™ ME Platform is a modified version of the Sun Java Wireless Toolkit (WTK). The Sony Ericsson SDK supports all Java APIs implemented on Sony Ericsson phones and includes detailed documentation (JavaDocs) of these APIs.

Installing and updating the SDK

InstallingBefore installing the Sony Ericsson SDK for the Java™ ME Platform, the SDK Java SE Development Kit need to be installed. Installation of an IDE can be done either before or after installing the Sony Ericsson SDK for the Java™ ME Platform. Note that an IDE is not required but is highly recommended.

UpdatingThe latest version of the Sony Ericsson SDK for the Java™ ME Platform is available for download at www.sonyericsson.com/developer/java.

After updating the SDK to a newer version, it is recommended to clear all platforms in the IDE and then reselect all profiles from the latest SDK version.

Integrating the Sony Ericsson SDK for the Java™ ME Platform in NetBeans 6

The Sony Ericsson SDK has been tested and found working with NetBeans 6.5.1.

In the instructions below, <SDK_Path> stands for the path where the Sony Ericsson SDK for the Java™ ME Platform is installed.

Note: Integration of the Sony Ericsson SDK for the Java™ ME Platform in NetBeans requires NetBeans Mobility Pack add-on.

To add the Sony Ericsson emulator:1. In the Netbeans window, select the menu Tools/Java Platform Manager.

2. Select Add Platform...

3. Select Java ME MIDP Platform Emulator.

4. Press Cancel, select the <SDK_Path>\Java_ME_SDK_CLDC\ directory. Select the WTK2 platform.

5. Click Next and follow the installation process to the end.

45 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

To set the platform and phone that will be used for emulation:1. In the Netbeans window, right-click on your project, select Properties and select platform in the table

to the left.

2. Use the drop-down list Emulator Platform to select the WTK2 platform added above.

3. Use the drop-down list Device to select phone to emulate.

4. Click OK.

Note: If NetBeans complains about the missing file "zayit.dll" when trying to run your project with a Sony Ericsson emulator, you should reboot the computer and try again.

Integrating the Sony Ericsson SDK for the Java™ ME Platform in Eclipse MTJ

Eclipse can be downloaded from http://www.eclipse.org/downloads/index.php.

More information about Eclipse MTJ can be found at http://www.eclipse.org/dsdp/mtj/

Guides for installation and configuration of Eclipse MTJ can be found athttp://www.eclipse.org/dsdp/mtj/development/tutorial/gettingstarted.php.

Adding the PC emulator to the Eclipse workspaceSelect the menu Window->Preferences. The “Preferences” dialog opens.

Select in the left tree: Java ME/Device Management

In the right panel, click the Import button and add the Wireless Toolkit: C:\SonyEricsson\JavaME_SDK_CLDC\WTK2.

46 March 2010

Developers guidelines | Java™ ME, CLDC – MIDP 2 – Windows Mobile 6.5

47 March 2010

Links and references

Specifications

The Java ME platform

CLDC 1.1 (JSR-139) http://www.jcp.org/en/jsr/detail?id=139

JTWI R1 (JSR-185) http://www.jcp.org/en/jsr/detail?id=185

MIDP 2.0 (JSR-118) http://www.jcp.org/en/jsr/detail?id=118

MIDP 2.1 (JSR-118 maintenance release) http://jcp.org/aboutJava/communityprocess/maintenance/jsr118/JSR_118_MR2_Changelog.pdf

MMAPI (JSR-135) http://www.jcp.org/en/jsr/detail?id=135

AMMS (JSR-234) http://www.jcp.org/en/jsr/detail?id=234

WMA (JSR-120) http://www.jcp.org/en/jsr/detail?id=120

WMA 2.0 (JSR-205) http://www.jcp.org/en/jsr/detail?id=205

Mobile 3D Graphics API (JSR-184) http://www.jcp.org/en/jsr/detail?id=184

Optional Package (JSR-75) http://www.jcp.org/en/jsr/detail?id=75

Java ME Web services 1.0 (JSR-172) http://www.jcp.org/en/jsr/detail?id=172

Mobile Internationalisation API (JSR-238) http://www.jcp.org/en/jsr/detail?id=238

Security and Trust API (JSR-177) http://www.jcp.org/en/jsr/detail?id=177

Location AP! (JSR-179) http://www.jcp.org/en/jsr/detail?id=179

Content Handler AP! (JSR-211) http://www.jcp.org/en/jsr/detail?id=211

Mobile Sensor AP! (JSR-256) http://www.jcp.org/en/jsr/detail?id=256

Sony Ericsson Developer World http://www.sonyericsson.com/developer/

OTA Provisioning http://java.sun.com/products/midp/OTAProvisioning-1.0.pdf

Sun Developer Network (SDN) web site with Java Technical documentation

http://java.sun.com//

Java Consumer Software Documentation Web site

http://java.sun.com/javame/reference/apis.jsp

Mascot Capsule Micro3D version 4(JSR-184) plugins

http://www.mascotcapsule.com/toolkit/m3g/en/index.php