J2ME learning temperature, knowing new articles

xiaoxiao2021-03-06  71

This is probably the first article of J2ME Development Network. Although there is no milestone meaning but how much will I witness the history of J2ME development network. This article will make a detailed summary of J2ME and clarify the context.

The most important part of learning J2ME is to master J2ME architecture. J2ME is Sun for the development platform for embedded consumer electronics, in fact it is a series of technologies and standards. The core of J2ME is Configuration (configured). The purpose of Configuration is to define a set of vertical APIs and serving a wide range of devices, and VM is also specified in the Configuration layer. The above is a profile (description), which is running on the Configuration, and its purpose is to provide support for a class with certain important features. These features are important, but they are not on all devices. Sun has two standard configurations for hardware layers of the hardware layer on the current market, and the memory and network connection capabilities are proposed. This is CLDC and CDC. At present, China mentioning J2ME refers to CLDC MIDP facts inaccurate, ignoring a more powerful CDC is difficult to forgive. The mating exception is flexible in the configuration and description, in one configuration, you can support multiple descriptions at the same time, for example on the CLDC, we can run the program based on the MIDP. If the device is supported, you can also run the optional package such as Bluetooth. We will not learn from J2ME in J2ME. If you have to learn more about the history of J2ME, you can download the JSR specification reading, address is http://jcp.org

At present, popular development is mobile development, so we will mainly tell the main content of CLDC MIDP in this article. The following J2ME also refers to CLDC MIDP, but we must know that J2ME does not refer to CLDC MIDP.

The J2ME is not much. If you read the MIDP API, it is found that there is so hundreds of classes. Compared with thousands of libraries in J2SE, it is a small witch to see the big witch, which provides such a streamlined library to the developer's main reason is the resource resource resource restriction characteristics of mobile information equipment. Only three packs java.lang, java.io, and java.util are defined in CLDC1.0. This constitutes a language foundation of CLDC, and also includes KVM at this layer. When developing J2ME programs, I don't think about it because all J2SE libraries are supported in J2ME.

Learning J2ME is the fastest way is to write J2ME applications, read more code, write more. In J2ME, a new application mode - MIDlet is proposed. This class defines in javax.microedition.midlet.mIdlet, our MIDlet must extend this class and implement it three abstract methods Startapp (), PauseApp ) And destroyApp (). The method also reflects the life cycle of the MIDlet, and the MIDlet lifecycle is managed by AMS (Application Management Software, previously known as JAM). About the MIDlet lifecycle can be carefully referred to the API DOC.

Two months after the launch of CLDC, Sun launched MIDP1.0, which is exciting to provide GUI in MIDP, so developers can easily write J2ME applications, GUI Get class libraries in Javax. Definition in MicroEditon.lcdui, sugges in MIDP2.0 adds support for game development to launch a javax.microedition.lcdui.game package for developers to develop games. The UI in the MIDP does not take the design idea of ​​AWT or SWING because they are for PC, the main interaction on the mobile phone and other devices is completed by the button, so the AWT / SWING designed for the mouse keyboard event mechanism is not suitable for J2ME. platform. When you master the UI, we should know the interface and event processing of the J2ME platform in your mind, which is distinguished from advanced and low. Advanced interfaces and event processing are relatively simple, but the speed is fast and portable. Low-level user interfaces and time processing are relatively complex, but powerful and portable. Usually we use low UI when developing games. A small database is provided in the J2ME platform, he is Record Management System. His data is stored on a non-volatile memory, so it does not lose due to the procedure of the program and the shutdown of the phone, thereby providing persistent storage for the J2ME platform. The RMS design is small, and he is responsible for storing data and tag data. The data storage is facing sub-sections, and the RMS specification does not explain what data can be stored. As long as the data can be converted to the sub-section, it can be stored. RMS is marked by ID, but he is not an index. The design is certainly suitable for running on the phone, but we have added the developer's task, we must be responsible for storing data and reading data and representing data, there is a topic in this site, please refer to.

A very important framework in J2ME is GCF, which is defined in javax.microEditon.IO, providing the networking capabilities. In MIDP2.0, it provides support for TCP / IP. The core in the GCF is Connector, and the interface-oriented design makes the GCF have excellent extensibility. The problem we must involve in the development of the Internet of Threading is multithreaded. Because the networked operation must be completed in another thread, it cannot be mainly threaded, which is to avoid clogging. At this time, you should realize that it is actually the foundation of J2SE.

There is a very important concept in J2ME to be optional package, optional package is proposed for specific device functions, such as some devices can support mobile multimedia, then you can use MMAPI to perform related development.

In fact, the equipment manufacturers will develop some APIs for their own equipment to developers. Once you have used their API, then your application has lost portability, such as the NOKIA 6108 program cannot run on Motorola 388c. In order to improve the problem of these split APIs, SUN has made a certain strength specification in JSR185, which is the JTWI we know, and JSR185 did not provide new APIs, just specified for JTWI equipment, such as HEAP space 256K. Wait. Details can download the JSR specification reading.

I hope this article can help J2ME developers carefully

转载请注明原文地址:https://www.9cbs.com/read-90413.html

New Post(0)