Header Ads

Update to Sony Ericsson's Java Platform 8 (JP-8)

The recently revised Java ME Developers' Guidelines present Sony Ericsson's Java Platform 8 (JP-8) phones in two sub-categories – JP-8 (8.0-8.2) and JP-8 (8.3). There are currently 14 JP-8 phone series and JP-8.3 represents a sub-group of six phones with some additional functionality supported by the Content Handler API (JSR 211) and Mobile Sensor API (JSR 256).

In addition to a useful evolutionary outline of the JSRs included in JP-6, JP-7 and JP-8, here is an overview of the two JP-8 sub-categories and more information about the additional JP-8.3 functionality.

Sony Ericsson's Java Platform strategy
Sony Ericsson uses a platform approach to Java ME platform implementation allowing developers to focus on a platform rather than on a variety of phone product names. As a platform supports many phones, you can deploy one build across several phones saving time and effort.

The platforms are implemented through an evolutionary approach to ensure forwards compatibility between platform versions – illustrated by the diagram below:



Overview of JSRs in the most recent Sony Ericsson Java Platforms (the JSRs highlighted in green are Sony Ericsson additions and not mandated in MSA).

Phones belonging to JP-8 (8.0-8.2) and JP-8 (8.3)
All JP-8 phones are based on MIDP 2.1 and have the same core JSR set based on the Java umbrella standard Mobile Services Architecture (MSA) JSR 248. That said, some phones have different features such as a built-in GPS (e.g. W760, Z780) and an accelerometer (e.g. C902, K850, W910), so support for the Location API (JSR 179) and Mobile Sensor API (JSR 256) is hardware dependant. More information about each JSR is presented in the Java ME CLDC MIDP 2 Developers' Guidelines. Download>>

The major platforms revisions are incremented with minor revisions that can include additional functionality and improvements whilst ensuring backwards compatibility within the same Sony Ericsson Java Platform.

You can query the Sony Ericsson Java Platform on the phone with the "com.sonyericsson.java.platform" system property

System.getProperty("com.sonyericsson.java.platform");

The minor revisions to Sony Ericsson Java Platform 8 (8.1, 8.2) have consisted of minor improvements but 8.3 includes some additional features to cover security domains, PIMChangeListener, Mobile Sensor API (JSR 256) and the Content Handler (JSR 211).




Additional JP-8.3 functionality
You should exercise some care when using minor revision features since an application must run across the major platform family – carefully use exception handling and query the platform property to ensure that your application works as expected across the Sony Ericsson Java Platform family.

Note that it is not possible update an existing Sony Ericsson Java Platform 8 (8.0, 8.1, 8.2) phone to 8.3.

Security Domains
In a run-time permission dialog, the user will be presented with the following options:

When user is not allowed to increase the permission level, "Yes" and "No" is shown.
When user is allowed (according to spec) to increase the permission level, "Yes", "No" and the highest permission according to spec is shown e.g. "Yes, Never ask".
PIMChangeListener
PIMChangeListener Interface can be used by applications that need to receive events whenever PIMItems stored in a PIMList have been changed. Events are triggered by the following operations:

newly created and committed PIMItems (added)
modified or removed fields in existing PIMItems (modified)
permanently removed PIMItems from a PIMList (removed)
See PIM_Change_Listener folder for detailed information.

PIM_Change_Listener folder contains:

PIM_Change_Listener.zip
PIMChangeListener doc.zip: Java documentation
PIMChangeListener.jar: Stripped classes for compilation
JSR 256 sensors
A SensorConnection is created and opened using:

SensorConnection sc = openConnection(String sensorURL);

sensorURL can be retrieved for the following sensors:

Battery Level
Senses the battery level. The battery sensor supports charger_state on the second Channel which indicates whether the device is charging. It returns 1 if the device is charging (charger/usb) and 0 if no charger is connected.
SensorInfo[] infos = SensorManager.findSensors("battery_charge", null);
String sensorURL =infos[0].getUrl();
Signal strength
Senses the signal strength:
SensorInfo[] infos = SensorManager.findSensors("network_field_intensity", null);
String sensorURL =infos[0].getUrl();


JSR 211 Music player
Content handler can be used to launch the native Music player (only available on Walkman phones). The code sample below illustrates:

Registry registry = Registry.getRegistry(this.class.getName());
Invocation invoc = new Invocation();
invocation.setID("com.sonyericsson.musicplayer");
invoc.setURL(file:///..../playlist.m3u); //optional, if not used a resume play will be made.
invoc.setResponseRequired(true);
boolean mustExit = registry.invoke(invoc);
if (mustExit) {
// App must exit before invoked application can run
destroyApp(true);
notifyDestroyed();
} else {
// Application does not need to exit
}

No comments:

Powered by Blogger.