Testing your J2ME application on a phone


A friend of mine recently asked me how one can test a J2ME application on a real phone as opposed to the emulator. This is a very simple task and so I thought I should do it right away. Here we go:

Your project folder probably looks like the following screenshot;

Project folder for the J2ME application

Project folder for the J2ME application

The main folder should be having the following folders;

  • build
  • dist
  • nbproject
  • src

and an xml file named “build.xml“.

In J2ME the jar file to be installed on the phone is automatically generated by the IDE and so you don’t need to run any command. Browse to the folder named dist and you should get the following;

  • A folder labelled “lib“.
  • A jad file labelled with the name of your app e.g. login.jad
  • A jar file labelled with the name of your app e.g. login.jar

What your now need to do is copy the jad and the jar file to your phone using for example a data cable, bluetooth or any other means. Once you have done that browse to the location of the jar file and execute it. You dont need to touch the .jad file,it is the application descriptor containing all the details about your application. That is all! If you face any problems just post a comment and I will get back to you.

Advertisements

2 thoughts on “Testing your J2ME application on a phone

    • Yes it should. The jad is the application descriptor, it tells the phone were all the application resources are. It refers to the jar file and they should therefore be in the same folder.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s