lunedì 29 novembre 1999

Update to JP-8 family

In the Sony-Ericsson developer website we can find an useful article about their JP-8 platform that at the moment includes 14 devices.

 The most innovative supported API by this family are the Content Handl
er APIs(JSR-211) and the Mobile Sensor APIs (JSR-256).

Sensor APIs can be used to get the network signal or the battery level.


Battery
SensorInfo[] infos = SensorManager.findSensors("battery_charge", null);
String sensorURL =infos[0].getUrl();

Network signal
SensorInfo[] infos = SensorManager.findSensors("network_field_intensity", null);
String sensorURL =infos[0].getUrl();

The Content Handler APIs can be used to launch the native music player to play an audio file.

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
}

You can read more about this topic in the Sony-Ericsson Developer Site

Nessun commento:

Posta un commento