| ID | CS001392 | Creation date | June 5, 2009 |
| Platform | S60 3rd Edition FP1, S60 3rd Edition FP2, S60 5th Edition, S40 3rd Edition FP 1 | Tested on devices | Nokia N80, Nokia N78, Nokia 5800 XpressMusic, Nokia 6131 |
| Category | Java ME | Subcategory | System information |
| Keywords (APIs, classes, methods, functions): System.getProperty, microedition.platform |
The following code snippet demonstrates how to identify the platform version of the device using Java ME.
The platform version can be retrieved just like any system property using the method System.getProperty. The method returns a string containing the specified property.
/**
* Executes the snippet.
* Gets platform version and prints it to the log.
*/
private void executeSnippet() {
String platformVersion = System.getProperty("microedition.platform");
if (platformVersion != null) {
printString("Version: " + platformVersion);
} else {
printString("Version NOT found!");
}
}
The platform version is displayed on the screen.
This code snippet is part of the stub concept, which means that it has been patched on top of a template application in order to be more useful to developers. The version of the Java ME stub application used as a template in this snippet is v1.1.
No related wiki articles found