Archive for December, 2010

Learn About J2ME


The more advanced technological developments, especially in the mobile world, leading to the popular J2ME platform. Besides easy access to both CDMA and GSM mobile phones, J2ME is also supported by many major manufacturers, like Nokia, Sony Ericsson, Motorola and many more. Why J2ME widely used? And what the heck it is J2ME?

J2ME (Java 2 Platform, Micro Edition) or now known as JME is an abbreviation of the Java Micro Edition. From the stands it was to us a single java analysis that is designed specifically for small devices such as mobile or devices that have limited capabilities. Java ME is made in order to be able to run and perform almost any task that was done on desktops requires a standard and simple way to develop applications on devices that have limitations like small screens, limited memory, slow processors and others. Java ME was designed by Sun Microsystems which is a subsidiary of Oracle Corporation. JME or J2ME is one of the three editions of Java technology, the other editions of the J2EE server addressed to the system weight and J2SE are aimed at the Desktop Standard and workstation applications. The division is done because a size of Java will not be able get into all kinds of devices.

Why choose Mobile Application Developers Java ME or J2ME? That’s because the Java ME includes flexible user interfaces, robust security, and built-in network protocols and support for network and offline applications that can be downloaded dynamically. It consists of a number of specific components, which have been set by the industry through the Java Community Process (JCP). In addition, by using this Java tool we use to support across all platforms. Java ME itself is a simple Java API developed by the developers themselves, because it is a kind of open source and is platform independent. If the programs are designed to be written in the form of Java, the program will be run anywhere but still within the scope of Platform Independent. Developers can create modular programs and code that can be used again. Additionally the user or the developer does not need to pay a heavy license annually.

After knowing what Java ME or J2ME, and what advantages-advantages we certainly interested in how I create a program application. But before making a program we need to know Java ME compiler first. To create J2ME applications do not require complicated software and large. One of them we can use the J2SE SDK / JDK. In it there is a runtime and library for Java programs in general as well as for J2ME. In addition we also need an IDE or integrated development environment for writing source code that can be downloaded at their official websites. Immediately below the Java code is easier to learn and no more complicated than in C or C + +. Type of files generated by the J2ME JAR file and the size of the application is also not great.

The steps to create a simple application using Netbeans IDE v4.1, which I quoted from is as follows:

1.       Install J2SE SDK v1.4.2 (50MB)

2.       Netbean Install v4.1 (47MB)

3.       Install netbean Mobility Pack v4.1 (18MB)

4.       Run netbean v4.1, create a new project and select the category “Mobile” and the type of project
“Mobile Application”

5.       Select the location where to save the files of this project, “Set as Main Project” and “Create
Hello MIDlet “should not be changed (checked)

6.       On the page “Platform Selection” select “Device Configuration” = CLDC-1.0 and
“Device Profile” = MIDP-1.0 (the smallest version that can be used in all cellular
which support J2ME)

7.       After all finished (tempate was created), run this application by pressing
F6 key (the Run Main Project).

8.       Then this project will compile and the emulator will be out, use the mouse to operate the emulator, by pressing the keypad button pressed dalamemulator is much like regular phones.

9.       At this time, the application “Hello World” we have made and can be completed directly on the test on the actual provider.

These applications can be tested by sending them to mobile devices that support J2ME in the usual way we use to send files from your computer as usual.

Examples of programs which I have quoted is still a simple application. We can make the application better and bigger for example making games. Therefore, when we were tired of playing those games other people’s work, we can try to make our own game. But if you want to make a game of course we also have to have a high skill of the graphic. So the games that we make not only good in terms of the game’s storyline but also good at graphic appearance. Did not rule the game of our work will also be liked by others.

For making the game we can use game builder. In manufacturing we will meet with the mainmidlet. Mainmidlet consists of 3 methods. The three methods are:

1.       startApp () is called to start the game.

2.       PauseApp () is called to pause the application, the application can proceed by resumeMIDlet call ().

3.       . DestroyApp (boolean unconditional) is called when exiting the application.

If we use neatbeans (same as we use them on a simple application example) then the method is automatically generated by creating a visual MIDlet. Display can be set on gamecanvas either at the end and inside gamecanvas by SetCurrent method. With this gamecanvas we can create an image,shape, or a string. GameCanvas This can simplify the reading of a process.

Time of a game controlled by Tick. Tick this is a integer that deal with the timer, for example, long an object will appear and how long a frame will appear. While the figures in a game called Sprite. In the manufacture of each sprite sprite made must have the same height and width on each movement except the sprites that you created in the design will have a special ability to change the form itself.

For an example of source code on the J2ME game programming can be downloaded at java files you can open with WordPad.

Try it and Good Luck 😀