| |
31. 1. 4. 预先定义的属性检索 |
|
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.midlet.MIDlet;
public class RuntimeAccessMIDlet extends MIDlet {
public void startApp() {
System.out.println("MIDlet-Name: " + getAppProperty("MIDlet-Name"));
System.out.println("MIDlet-Vendor: " + getAppProperty("MIDlet-Vendor"));
System.out.println("MIDlet-Version: " + getAppProperty("MIDlet-Version"));
System.out.println("MIDlet-Description: " + getAppProperty("MIDlet-Description"));
System.out.println("Target-Devices: " + getAppProperty("Target-Devices"));
System.out.println("Display-Size: " + getAppProperty("Display-Size"));
InputStream is = this.getClass().getResourceAsStream("/readme.txt");
try {
if (is != null) {
int character;
while ((character = is.read()) != -1) {
System.out.print((char) character);
}
is.close();
}
} catch (IOException e) {
System.out.println(e);
}
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}
|
|
|