System.getProperty(String key) 獲取。MIDlet.getAppProperty(String key) 獲取。| JSR | 屬性名 | 默認值/說明 |
|---|---|---|
| 30 | microedition.platform | null (設備平台名) |
| 30 | microedition.encoding | ISO8859_1 (默認字符編碼) |
| 30 | microedition.configuration | CLDC-1.0 |
| 30 | microedition.profiles | null |
| 37 | microedition.locale | null (當前語言環境) |
| 37 | microedition.profiles | MIDP-1.0 |
| 75 | microedition.io.file.FileConnection.version | 1.0 (JSR 75 文件連接 API 版本) |
| 75 | file.separator | impl-dep (文件分隔符) |
| 75 | microedition.pim.version | 1.0 (PIM API 版本) |
| 118 | microedition.locale | null |
| 118 | microedition.profiles | MIDP-2.0 |
| 118 | microedition.commports | impl-dep (串口支持) |
| 118 | microedition.hostname | impl-dep (主機名) |
| 120 | wireless.messaging.sms.smsc | impl-dep (SMS 服務中心號碼) |
| 139 | microedition.platform | impl-dep |
| 139 | microedition.encoding | ISO8859-1 |
| 139 | microedition.configuration | CLDC-1.1 |
| 139 | microedition.profiles | impl-dep |
| 177 | microedition.smartcardslots | impl-dep (智能卡槽) |
| 179 | microedition.location.version | 1.0 (LBS API 版本) |
| 180 | microedition.sip.version | 1.0 (SIP API 版本) |
| 184 | microedition.m3g.version | 1.0 (3D API 版本) |
| 185 | microedition.jtwi.version | 1.0 (JTWI 規範版本) |
| 195 | microedition.locale | impl-dep |
| 195 | microedition.profiles | IMP-1.0 (Information Module Profile) |
| 205 | wireless.messaging.sms.smsc | impl-dep |
| 205 | wireless.messaging.mms.mmsc | impl-dep (MMS 服務中心) |
註:impl-dep 表示由設備廠商具體實現決定;若設備不支持對應 JSR,調用將返回 null。
MIDlet-1: HttpWrapperMidlet,,httpwrapper.HttpWrapperMIDlet
MIDlet-Jar-Size: 16315
MIDlet-Jar-URL: HttpWrapper.jar
MIDlet-Name: HttpWrapper
MIDlet-Vendor: Vendor
MIDlet-Version: 1.0
MicroEdition-Configuration: CLDC-1.0
MicroEdition-Profile: MIDP-1.0
Which-Locale: en <-- 自定義應用屬性
import javax.microedition.midlet.*;
public class MyMIDlet extends MIDlet {
private String suiteName;
public MyMIDlet() {
suiteName = getAppProperty("MIDlet-Name"); // 讀取標準屬性
String locale = getAppProperty("Which-Locale"); // 讀取自定義屬性
}
// ...
}
null。.properties 文件,但更輕量、部署更簡單。掌握系統屬性表可實現設備能力檢測(如是否支持 JSR 75/179/184);善用應用屬性可實現靈活配置。開發中請始終遵循優先級規則,並注意可信應用的簽名一致性要求。