Sun SPOT getting properties from MANIFEST.MF

/ Published in: Java
Save to your folder(s)

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.

Copy this code and paste it in your HTML
  1. public class GetAppPropertiesSpotApp extends MIDlet {
  3. protected void startApp() throws MIDletStateChangeException {
  5. String nameOfFile=this.getAppProperty("NameOfFile");
  6. System.out.println("NameOfFile=" + nameOfFile);
  8. }
  9. protected void pauseApp() {}
  10. protected void destroyApp(boolean arg0) throws MIDletStateChangeException {}
  11. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.