Thursday, September 2, 2010

J2ME application development Getting Started nine major points

1, J2ME Java basic knowledge required in most people now are starting from scratch learning J2ME, J2ME's time to learn, always from the foundation to start learning Java, and now speaks all Java-based books to J2SE in terms of foundation, which caused some unnecessary to learn the trouble, the following will be used in J2ME and Java do not need to do the basics of a simple explanation. J2ME in ...

1, J2ME Java basic knowledge required in
Most people now are starting from scratch learning J2ME, J2ME's time to learn, always from the foundation to start learning Java, and now books about Java-based foundation are based on J2SE speaking, which led to the study some unnecessary trouble, the following will be used in J2ME and basic knowledge of Java do not need to do a simple explanation.


J2ME Java used to the basics:

1, Java syntax basics: the basic data types, keywords, operators, etc.

2, object-oriented thinking: the concept of classes and objects, inheritance and polymorphism and so on.

3, exception handling

4, multi-threaded

J2ME does not use the Java Basics:

1, JDK in order to use javac, and java

2, Java foundation classes in J2ME in a lot of no, or a class method done a lot of streamlining. Therefore, the proposed library in J2ME familiar.

3, Applet, AWT, Swing is the fundamental knowledge to use in J2ME not.

Simple so much, want to learn J2ME few friends to take some detours, deficiencies hope the positive corrections and additions.

2, J2ME features that temporarily can not be completed

Out a number of J2ME features that temporarily can not be completed, I hope all of you will add:

1, the phone does not change the code to achieve transplantation, mainly referring to the game.

2, the dynamic changes the button text.

3, to accept Chinese input in the Canvas.

4, the operation of local resources, such as address book, received text messages and so on.

5, producing destructive mobile phone virus.

6, the other waiting for you to add.

3, J2ME platform of cross-

J2ME technology from Java, it also has the advantage of JVM, you can support the Java platform in the transplant, but now the J2ME technology in cross-platform, but do bad, let's briefly look at the reasons:

1, mobile phone screen sizes vary:

The main production on the interface. If you are using advanced user interface, such as you to do is to application development or user login, user registration such common functions, generally without any problems.

If you are using a low-level user interface, such as you do is gaming, then you need to consider this issue.

2, the expansion of API manufacturers are not uniform:

For example, the expansion of Nokia UI API library series, in other phones or not achieved, or different package names and so on.

3, mobile platform to achieve the bug:

For example, the 7650 Nokia have in achieving the double-buffer bug, then run the software on this model can not use double buffering. NOKIA on some of the other bug.

4, mobile performance problems.

Different mobile phones available memory, the largest jar files are required, such as Nokia S40 mobile phone support most of the biggest jar file is 64K, most available content is 210K.

So the mobile phone software, especially games list of all supported models also have a cell phone game transplantation presence.

Fourth, learn to engage in the kind of work J2ME

Now J2ME technology can be quite hot, here are some J2ME can then be engaged to learn the types of work:

1, J2ME Game Developer

According to the game plan or document required in a particular type (for Nokia S40 or S60 mostly) developing games. This is now the majority of the work J2ME programmer.

Need to master: Advanced user interfaces, low-level user interface thread, if the network game, but also skilled network programming.

2, J2ME application developers

Now is not a lot of mobile applications, but there were some, particularly the mobile location and mobile business-related content. Need to master: Advanced user interface thread and network programming.

3, J2ME games transplant staff

Reference source code, will be able to run on a platform game ported to other platforms go up. Such as Nokia S40 games ported to S60, or Sony Ericsson's T618 and so on. Mainly control the screen coordinates, and some may need to replace some of the API.

Need to know the difference between the platform and the related technical parameters, such as screen size, the largest jar file size, etc..

5, J2ME program design of several principles

1, using object-oriented programming.

Although the use of process-oriented programming can reduce the file size, but to maintain convenient and conducive to future expansion, or to use the object-oriented programming.

MVC Pattern
The model, interface and control the separation. Now many of the procedures will be three-one, but if you do procedures relatively large, then suggest you to be separated.

3, automatically stores user settings

Use RMS to store user information, such as storing user last entered user name, password, user settings, etc. for the system, not only can reduce the user's input, but also user-friendly. Many programs can even make an automatic landing.

4, a number of system settings allow users to turn off. Such as background music, background light display.

5, the low-level user interface rendering action in a separate thread to go inside.

6, in the amount of time needed to complete the work, to the user interface of a wait.

6, from the simulator to the real machine test

For J2ME developers, the simulator gives us a lot of convenience, such as in the emulator debugger, and very easy to see the program's effectiveness, but simulator also gives us some problems, such as simulator the bug and so on, so a real machine testing is necessary.

1, Why the real machine test?

Because the simulator program possible bug, and the real machine's performance is limited, so must be true test.

2, how to program transferred to the machine?

The program transferred to the machine are as follows:

a) OTA Download

b) use a data cable transfer

c) Infrared transmission

d) Bluetooth

Conditions you can choose the suitable way.

3, the main measure a real machine test what?

Real machine test many things, mainly testing the following:

a) program features

b) operational procedures, it is easy to operate

c) the size of the program, such as Nokia S40 series phones most of the accepted maximum file size is 64K

d) running speed, the speed is tolerable.

7, to the vendor from the WTK SDK

For J2ME lovers, basically we are all from the SUN's WTK (J2ME Wireless Toolkit) started, but for practical applications, using only the WTK is not enough, so in the learning process must be completed from the WTK leap to the SDK.

1 vendor SDK download address?

· Nokia

Nokia mobile phone industry is worthy of the boss's support for j2me is excellent, with a special website and a variety of documented SDK.

Website is: http://forum.nokia.com.cn/sch/index.html

· Siemens

Siemens is also a good support for J2ME, which provides SDK, simulator requires separate installation. Download the following address:

https: / / communication-market.siemens.de/portal/main.aspx? LangID = 0 & MainMenuID = 2 & LeftID = 2 & pid = 1 & cid = 0 & tid = 3000 & xid = 0

· SonyEri CSS on

SonyEri CSS on SDK and its emulator, download address is:

http://developer.sonyeri CSS on.com / site / Global / docstools / Java / p_java.jsp

http://mobilityworld.eri CSS on.com.cn / development / download_hit.asp

· Motorola

Motorola offers a special SDK, including the internal simulator, download address is:

http://www.motocoder.com/motorola/pcsHome.jsp

· SamSung

SamSung also provide a special SDK and emulator, download address is:

http://developer.samsungmobile.com/eng/front_zone/bbs/bbs_main.jsp?p_menu_id=1500

· NEC:

NEC also provides an integrated simulator of the SDK, download address is:

http://www.nec-mfriend.com/cn

2 vendors SDK and WTK What is the difference?

The simplest understanding of vendors SDK is based on the increase in the WTK emulator and his own extended API. In other words, you use the vendor's SDK, you can use the expansion of library vendors such as Nokia's UI library and the vendor only their own simulator. API extensions for each vendor are not numerous and varied.

3, How to use?

Some manufacturers use SDK and WTK are the same, such as SamSung. Nokia provides a separate interface to develop, but the actual development of this interface in use much.

4, issue vendor SDK

Machine for inconsistencies. For example, problems like NOKIA mix playback.
8, in the J2ME way to get phone IMEI

IMEI is the Internation mobile entity identification of short, in the phone enter * # 06 # to display the number, length 15, the only, never conflicts, it can be taken as a sign of the user.

The following is to get IMEI in J2ME methods:

1, MOTO series of phones you can read the IMEI system property access, the code is as follows:

String imei = System.getProperty ("IMEI");

2, SIEMENS series of phones you can read the system com.siemens.IMEI property acquisition, the code is as follows:

String imei = System.getProperty ("com.siemens.IMEI");

9, J2ME network connection solution to the problem shown in

In network programming, sometimes not received some in the network data interface on the display, causing the interface is not consistent with requirements (such as bulletin shows that notice will be displayed before the background image and then display the information notice), to mention here a simple solution for you:

Way to solve this situation is divided into three steps:

1, the need to display interface, the call to send network data. Each display is called the constructor does not call the method display Display of setCurrent.

2, showing wait interface (such as progress bars, etc.), to the user prompts, making the network connection.

3, in dealing with the network after completion of data feedback, call the Display of setCurrent display shows the current interface methods.

No comments:

Post a Comment