|
How to read MIDLET attributes at runtime |
|
|
MIDlet attributes are defined in the JAD file of each MIDlet suite. A MIDlet
can access the values of these attributes at runtime using the MIDlet class's methods.
The example code below shows how to reach the mandatory attributes:
/**
Prints application properties using the
MIDlet.getAppProperty() call.
*/
public void startApp() throws MIDletStateChangeException {
System.out.println("Vendor: " +
getAppProperty("MIDlet-Vendor"));
System.out.println("Description: " +
getAppProperty("MIDlet-Description"));
System.out.println("JadFile Version: " +
getAppProperty("JadFile-Version"));
System.out.println("MIDlet-Data-Size: " +
getAppProperty("MIDlet-Data-Size"));
System.out.println("MIDlet-Name: " +
getAppProperty("MIDlet-Name"));
System.out.println("MIDlet-Jar-Size: " +
getAppProperty("MIDlet-Jar-Size"));
System.out.println("MIDlet-jar-Size: " +
getAppProperty("MIDlet-Jar-URL"));
}
|
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.