Sunday, April 18, 2010

Hello friendz ! Now a days m learning J2ME mobile application technology n believe me its really very interesting. All you need is just a l'il bit knowledge of java programming language. Here I'll demonstrate some basic things of J2ME language which would help many of you.
Lets start with a small "Hello World" application which will print Hello World On Your mobile while running.......
Just open NetBeans IDE n click on New Project(Ctrl+Shift+N)>>Choose Java ME(Categories)>>Mobile Application(Projects)>>Now click on NEXT>>

Now enter the project name(HelloWorld)>>And uncheck the below Create Hello MIDlet check box.

>>Click on NEXT>>Select Device profile: MIDP-2.0>>And then click on finish

Now click on +Source Package >> Then right click on >> New >> MIDlet...

Write the name of the MIDlet (anything) and click on finish button

Then you'll see a screen similar to following

Import the javax.microedition.lcdui.*; namespace to your application
Now just add the four lines of code in startApp() method

 To show a message to user we use Alert as i used above
press F6 to run the application

Click on launch

To Find the .jar file goto >>> My Documents\NetBeansProjects\HelloWorld\dist folder where you can find the helloWorld.jar application which can be easily run in any java technology enabled mobile phone (Nokia , Sony etc.)

0 comments:

Post a Comment