[J2ME] 获得MIDlet信息

 

 1 import javax.microedition.lcdui.Display;
 2 import javax.microedition.lcdui.Form;
 3 import javax.microedition.lcdui.TextField;
 4 import javax.microedition.midlet.MIDlet;
 5 import javax.microedition.midlet.MIDletStateChangeException;
 6 
 7 
 8 public class main extends MIDlet {
 9     
10     private Display ds;
11     private Form fr;
12     private TextField tf;
13     private String proString="";
14     
15     public main() {
16         // TODO Auto-generated constructor stub
17         proString=proString+"厂商: "+getAppProperty("MIDlet-Vendor")+"\n";
18         proString=proString+"描述: "+getAppProperty("MIDlet-Description")+"\n";
19         proString=proString+"自定义版本: "+getAppProperty("jadFile-Version")+"\n";
20         proString=proString+"数据空间: "+getAppProperty("MIDlet-Data-Size");
21         fr=new Form("MIDlet Properties");
22         tf=new TextField("属性:",proString,500,TextField.ANY);
23         fr.append(tf);
24     }
25 
26     protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
27         // TODO Auto-generated method stub
28 
29     }
30 
31     protected void pauseApp() {
32         // TODO Auto-generated method stub
33 
34     }
35 
36     protected void startApp() throws MIDletStateChangeException {
37         // TODO Auto-generated method stub
38         ds=Display.getDisplay(this);
39         ds.setCurrent(fr);
40     }
41 
42 }

 

posted @ 2014-07-26 16:05  beautifulzzzz  阅读(501)  评论(0编辑  收藏  举报