MIDLET is an application model proposed in MIDP and is currently applying in J2ME. This article will mainly introduce the properties of the MIDP application. Reader can refer to
MIDP Application Properties
MIDlet can access the two runtime attribute values: systems and applications.
The concept of system attribute is defined in CLDC (Connected Limited Device Configuration), the property value is written to the underlying system, and we can read them but cannot modify these attribute values. If you want to read a system properties, you can read it using the static method of the System class system.getProperty (). Some netizens often ask how to read mobile numbers or IMEI numbers, in fact, these you should refer to the specific model development document. The implementation of each manufacturer is different. In order to let everyone find it convenient to list the system attribute values defined in J2ME, if your phone supports the associated JSR, then the attribute value can be obtained by the above method.
JSRProperty NameDefault Value¹30microedition.platformnull microedition.encodingISO8859_1 microedition.configurationCLDC-1.0 microedition.profilesnull37microedition.localenull microedition.profilesMIDP-1.075microedition.io.file.FileConnection.version1.0 file.separator (impl-dep) microedition.pim.version1.0118microedition. localenull microedition.profilesMIDP-2.0 microedition.commports (impl-dep) microedition.hostname (impl-dep) 120wireless.messaging.sms.smsc (impl-dep) 139microedition.platform (impl-dep) microedition.encodingISO8859-1 microedition.configurationCLDC -1.1 microedition.profiles (impl-dep) 177microedition.smartcardslots (impl-dep) 179microedition.location.version1.0180microedition.sip.version1.0184microedition.m3g.version1.0185microedition.jtwi.version1.0195microedition.locale (impl-dep) MicroEdition.profilesimp-1.0205wireless.Messaging.sms.SMSC (IMPL-Dep) 205wireless.MESSAGING.MMS.MMSC (IMPL-DEP)
The application property value is defined in the application descriptor file or the manifest file (where the manifest file is in the JAR file), which will define application properties when we deploy the application. Here is a typical example of jad file contents: 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-local: EN where which-locale is the application attribute value, we can get it through the MIDlet's member method getAppproperty (), the code segment is as follows:
Import javax.microedition.midlet. *;
Public class mymidlet extends MIDlet {
PRIVATE STRING Suitename;
Public mymidlet () {
Suitename = GetAppproperty ("MIDlet-name");
... // More stuff
}
... // ETC.
}
Attribute values are case sensitive, if the attribute value is not defined in the system, JAD file, and manifest file, then NULL will be returned. If the same attribute value is defined in the JAD file and the manifest file, then the following cases occur: If the application is a trust application for MIDP2.0, the AMS will refuse to install. Otherwise, attribute values in the JAD file override the value in Manifest.
There must be some benefits in the JAD file, if you need to change some data, you don't want to recompile the code, if you pack it, then you can define some attribute values in JAD. This can be configured with your app, think about whether it is similar to you using the properties file in the J2SE application. But don't define a large amount of data in the JAD article, because many devices are limited to the size of the JAD file.