Return to Snippet

Revision: 3271
at July 1, 2007 22:18 by javapda


Initial Code
public class GetAppPropertiesSpotApp extends MIDlet { 

    protected void startApp() throws MIDletStateChangeException {

        String nameOfFile=this.getAppProperty("NameOfFile");
        System.out.println("NameOfFile=" + nameOfFile);

    }
    protected void pauseApp() {}
    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {}
}

Initial URL


Initial Description
Shows how to access properties in the resources/META-INF/MANIFEST.MF file.
Presumably this file would have an entry like the following:
NameOfFile: winners.txt
The following code accesses this property at runtime from within the MIDlet and prints it to the console.

Initial Title
Sun SPOT getting properties from MANIFEST.MF

Initial Tags


Initial Language
Java