Java Reference
In-Depth Information
4.2 Detecting Diversity using Properties
In Chapter 3, we used JSRsDetectorMIDlet to detect support for JSRs
on Symbian smartphones. We use this technique again in Section 4.4.
For now, there are other details about the Java ME subsystem that you
probably want to find out. Another method of detecting device capabilities
is by querying the system properties.
System properties can be retrieved using the System.getPro-
perty() method, which receives as a key the name of a system property
and returns its value (or NULL if there is no property with that key). The
system properties are logically grouped into properties that give informa-
tion about the environment, package discovery, JSR capabilities and the
device-specific properties.
(a)
(b)
Figure 4.1 Environment system properties on a) Nokia N95 and b) Sony Ericsson W960i
You can get information about the Java ME environment (see Figure
4.1), for example:
microedition.profiles is a list of the profiles that the device
supports. For MIDP 2.0 devices, this property contains at least MIDP-
2.0.
microedition.platform returns the identifier of the platform
(e.g., you can identify whether you are running on the Nokia N95 or
Sony Ericsson W960i).
Search WWH ::




Custom Search