J2ME itself is the technology of the Java programming language are in dedicated to mobile devices like mobile phones, Pocket PCs and what else yah. Just create a small device that is often taken anywhere that you know. J2ME is the same with programming using java itself, only in J2ME there is some functionality added and subtracted and are customized for mobile device programming.
Obviously to be able to create games in HP we have to get used to first use the programming with java, here I will not review the java programming language-maybe next time in a different post-I expect you already have knowledge of java before. Here I will only provide knowledge about the tools used in making Java programs on HP and concepts.
For tools I use IDE (Integrated Development Environment) NetBeans version 6 which can be downloaded for free here, select NetBeans Mobility Pack is included. So that we can lock write code without having to install try again.
After you install the NetBeans IDE, NetBeans run it immediately. To create a new project select File-New Project. Will appear as shown below.
Select MIDP Application and press Next. Next you will be brought to the Name and Location screen like below.
Input Project Name corresponding to the name of your project and remove the check in the Create Hello MIDlet. Press Next
This is a screen to determine the target device with which you created the application. In line emulator Emulator Platform is a choice that you install on your computer, for now you just install the emulator default of your NetBeans. Once you feel the need to install emulators for specific platforms from other vendors such as Nokia, Sony Ericsson and Motorola you can change it here.
Device is a device emulator or HP who will you run on your computer, in running the program that you create. If later you install the emulator platform from another vendor you will be able to use HP's specific vendor.
Device Configuration and Profile are the specific capabilities of the device package that will you to target your application, for example I have a HP K608 that have CLDC 1.1 and MIDP specification 2.0 HP means I can run the program with a package that is on CLDC 1.1 and MIDP 2.0. For more information about the device you jadikat research target was the first to see the specifications HP or your target device.
To ease you understand, just imagine the old HP is MIDP 1.0, such as nokia 6015 and nokia is big with a slide that I forgot what the old HP brand and others. MIDP 2.0 new HP like the Nokia N70, N73, SE K600, SEW800 and others. Since MIDP 2.0 more a good idea to select MIDP 2.0 and CLDC 1.1 for our application this time.
Select Next and directly select Finish. Ready ready!
Actually in this NetBeans you can create applications with Visual MIDlet HP is in NetBeans, but to more deeply understand the concept of making an application in J2ME here I will not use the Visual MIDlet.
The concept of J2ME programs are as follows. In J2ME we have will make the main class derived from MIDlet class, main class derived from MIDlet is yag will be called the first time during our application running on HP, in the main class also there are 3 methods which will function as a triggering event from our HP. Like:
starApp (), method that is called when we first application of the road.
pauseApp () method that is called when the user hp pause our application.
destroyApp () method that is called when the user closes our application hp.
We start by creating a new classMIDlet for your project. Right-click your project in the project explore and select new-MIDlet, called the new class with name MIDletPertama. Last code your MIDlet file looks like below.
For the first time we will display the "Hello World J2ME" on the HP screen. There are two types of views within the MIDlet,
Low Level use the Canvas class
High Level use Form
Here we will use a form to facilitate you to understand the formation of the display in the MIDlet.
Notice the code above, frPertama is the object form which we will show in the layer, we give the title of Form is the "Title". Then append method is a method to add items on the Form, Item I want to add is the String "Hello World J2ME". Display statement is a statement to display the object fr First into the layer.
Select F11 to build the project and F6 to run the project.
Select the midlet who want to run and press launch in the emulator, then your emulator will display the form that you created, as shown below.
Congratulations, your program has been running well in the emulator, how to run on HP's real?
Log into your NetBeans project folder, open the folder dist
Transfer the jar file in your program to your HP channeled through Bluetooth, infrared or data cable
Tuesday, March 29, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment