Beginner's essentials for j2-based Program Development

Source: Internet
Author: User
1. Basic Java knowledge required in j2-java mobile network [www.cnjm.net]

Currently, most people have learned from the beginning of the Java program. When learning from the Java program, they always start learning from the basics of Java. Currently, all the books on the basics of Java are based on j2se, this makes some unnecessary trouble for learning. Below we will give a simple description of the basic knowledge of java used and not needed in Java.

Java mobile network [www.cnjm.net]

Basic Java knowledge used in j2s:

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

2. Object-oriented Thinking: Concepts of classes and objects, inheritance and polymorphism, etc.

3. Exception Handling

4. Multithreading

Basic Java knowledge not used in j2s:

1. Use of javac and Java commands in JDK

2. Many classes in the Java foundation do not exist in j2s, or the methods in the classes are greatly simplified. Therefore, it is recommended that you familiarize yourself with the class library in j2s.

3. Knowledge of Applet, AWT, and swing cannot be used in j2s.

To put it simply, I hope that my friends who want to learn j2s can take less detours. I hope you can actively correct and supplement the shortcomings.

2. functions that cannot be completed for the moment in j2-java mobile network [www.cnjm.net]

List some functions that cannot be completed for the time being in j2s. I hope you can actively Add:

1. Do not change the code in the mobile phone for porting, mainly refers to the game.

2. Modify button text dynamically.

3. Accept Chinese input on the canvas.

4. Operate on local resources, such as the address book and received short messages.

5. Create a destructive mobile phone virus.

6. Others will be added.

Iii. cross-platform Java mobile phone network of j2-based systems [www.cnjm.net]

Because of the Java technology, it also has the JVM advantage. It can be transplanted on a platform that supports Java. However, the current j2's technology is very bad on a cross-platform, let's take a brief look at the reasons:

1. Different screen sizes of mobile phones:

This is mainly made on the interface. If you are using an advanced user interface, such as application development, user login, and user registration, there is generally no problem.

If you are using a low-level user interface, such as a game, you need to consider this issue.

2. The vendor's extended APIs are not uniform:

For example, the extended API class library UI series of Nokia is not implemented on other mobile phones, or the package name is different.

3. Bugs implemented on mobile platforms:

For example, if Nokia 7650 has a bug in implementing dual buffering, the software running on this model cannot use dual buffering. Other Nokia bugs, see: http://blog.csdn.net/Mailbomb/archive/2005/03/24/329123.aspx

4. Mobile phone performance problems. Java mobile network [www.cnjm.net]

The available memory and maximum jar files of different mobile phones are required. For example, the maximum jar files supported by most mobile phones of Nokia s40 are 64 KB and the maximum available content is 210 KB.

Therefore, the current mobile phone software, especially the list of models supported by games, also has the presence of mobile game porting personnel. Java mobile network [www.cnjm.net]

4. Learn the types of work that can be done by j2s

Java mobile network [www.cnjm.net]

Currently, the technology of j2_based is quite violent. Here we will introduce some types of work that can be done after learning j2_based architecture:

1. Game Developers

Java mobile network [www.cnjm.net]

Develop game programs on a specific model (mostly Nokia s40 or s60) Based on Game planning or documentation requirements. This is the work that most of the current programmers are engaged in.

Be familiar with: Advanced user interfaces, low-level user interfaces, and threads. For online games, you also need to be proficient in network programming.

2. J2EE application developers

Java mobile network [www.cnjm.net]

There are not many mobile applications, but there are still some, especially mobile positioning and mobile commerce-related content. Need to be familiar with: Advanced user interface, thread and network programming.

3. j2_game porting personnel

By referring to the source code, you can port games that can run on one platform to other platforms. For example, porting a Nokia s40 game to s60 or Sony Ericsson's t618 game. It mainly controls screen coordinates, and some APIs may need to be replaced.

Be familiar with the differences between platforms and related technical parameters, such as screen size and maximum JAR file size. Java mobile network [www.cnjm.net]

5. Several principles for designing the j2_based Program

1. Use object-oriented programming.

Although process-oriented programming can reduce the size of a file, it is still necessary to use object-oriented programming for the convenience of future maintenance and expansion.

2. Use the MVC Mode

Separate models, interfaces, and controls. Many programs are now integrated, but if you do a large number of programs, we recommend that you separate them.

3. automatically store user settings

RMS is used to store user information, such as the user name, password, and system settings that the user entered last time. This not only reduces user input, but also makes user friendly. Many programs even perform automatic login.

4. Some system settings allow users to close. Such as background music and background light display.

5. Place the draw action of the low-level user interface in an independent thread.

6. When a large amount of time is required to complete the work, a waiting interface is provided for the user.

6. Test from simulator to real machine

The simulator brings us a lot of convenience, for example, debugging the program in the simulator and viewing the program effect conveniently, but the simulator also brings us some problems, for example, the bug implemented by the simulator, so it is necessary to perform a real machine test.

1. Why do we need to perform a real machine test?

Because the simulator program may have bugs and the performance of the real machine is limited, you must perform a real machine test.

2. How do I transmit programs to machines?

Java mobile network [www.cnjm.net]

The following method is used to transmit a program to a machine:

A) OTA download

B) Data Transmission

C) Infrared Transmission

D) Bluetooth

You can select an appropriate method based on the conditions.

3. What are the main tests for real machine testing?

Real machine testing involves a lot of content, mainly testing the following aspects:

A) Functions of the program

B) Procedural operability and ease of operation

C) program size. For example, the maximum file size for most Nokia s40 mobile phones is 64kjava mobile phone network [www.cnjm.net].

D) whether the program running speed is tolerable.

Java mobile network [www.cnjm.net]

7. From wtk to vendor SDK

For those who are enthusiastic about the use of wtk, we basically started with Sun's wtk, but for practical applications, simply using wtk is far from enough, therefore, in the learning process, you must complete the transition from wtk to SDK.

1. What is the vendor SDK?

· Nokia Java mobile phone network [www.cnjm.net]

Nokia is worthy of being the leader in the mobile phone industry. It also provides first-class support for j2's. There are specialized websites that provide sdks and various documentation.

Web site: http://forum.nokia.com.cn/sch/index.html

· Siemens

Siemens also provides good support for j2_m2. it provides sdks and the simulator needs to be installed independently. As follows:

Https://communication-market.siemens.de/portal/main.aspx? Langid = 0 & mainmenuid = 2 & leftid = 2 & pid = 1 & cid = 0 & tid = 3000 & Xid = 0

· Sonyericsson

The sonyericsson SDK and its own simulator are as follows:

[Url] http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp/url]
Http://mobilityworld.ericsson.com.cn/development/download_hit.asp

· Motorola

Motorola provides a dedicated SDK that contains a simulator:

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

· Samsung

Samsung also provides specialized sdks and Simulators for: Java mobile network [www.cnjm.net]

Http://developer.samsungmobile.com/eng/front_zone/bbs/bbs_main.jsp? P_menu_id = 1500

· NEC:

NEC also provides an SDK that integrates the simulator:

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

2. What is the difference between the vendor SDK and wtk?

The vendor SDK adds its own simulator and its own extended API Based on wtk. That is to say, when you use the vendor's SDK, you can use the vendor's extended class library, such as the Nokia UI class library, and the vendor's own simulator. There are not many extensions for each vendor, and they are different.

3. How to use it?

Some vendors use the same SDK as wtk, such as Samsung. Nokia provides an independent interface for development, but this interface is rarely used in actual development.

4. Vendor SDK Problems

The vendor SDK has some bugs and is inconsistent with the real machine implementation. For example, audio mixing and playback problems of Nokia.

8. How to obtain the IMEI of a mobile phone in j2_m2.

IMEI is short for internation mobile entity identification. You can enter * #06 # on your mobile phone to display this number. The length is 15 bits. It is globally unique and will never conflict with each other, therefore, it can be used as a sign to identify users.

The following method is used to obtain IMEI in j2_m3:

1. The Moto series phones can be obtained by reading the IMEI attribute of the system. The Code is as follows:

String IMEI = system. getproperty ("IMEI ");

2. The mobile phones of the Siemens series can be obtained by reading the com. Siemens. IMEI attribute of the system. The Code is as follows:

Java mobile network [www.cnjm.net]

String IMEI = system. getproperty ("com. Siemens. IMEI ");

9. solutions to problems displayed in the network connection

In network programming, some interfaces are displayed when no network data is received, causing non-conforming display on the interface (such as announcement display, the background image of the announcement is displayed before the announcement information is displayed. Here is a simple solution:

The solution is divided into three steps:

1. Call the method for sending network data on the interface to be displayed. This constructor is called every time the display is displayed, and the display setcurrent method is not called.

2. display the wait interface (such as the progress bar) and prompt the user to connect to the network.

3. After processing the network feedback, call the setcurrent method of display to display the current interface.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.