Sunday, September 6, 2009

Installing a J2ME app you built in your phone...

Hi dudes,

I am really a new comer for this field and when i developed my very first J2ME app in netbeans IDE, I wanted it to install in my phone. So just made a little googling and came up with a general idea.

Before googling when i explored the packages created by netbeans IDE, i found in the 'dist' folder there are jar and jad files. SO i directly send them to my phone and tried to install. But while the process is in the half way installing, it gave the massage 'invalid operation'.

Then I write click on my project, go properties, deploying and set the Deployment Method to "File Copy" and i set a valid folder. I right clickd on my project again and i selected "Deploy" to which it compiles it all as it should and it creates a JAR and a JAD in the specified folder. Now how do i actually go about getting this onto my phone? I have tried sending both the JAR and JAD to my phone (one at a time of course because even selecting both and going send will only send them one at a time) via bluetooth and USB, and the phone recognizes it as a Java program like everything else i have downloaded and recieved, but when it tries to install it (Says "Please Wait" for a few seconds), it says "Operation Failed". Dissapointment again :-(

But after googling i found out that i need to install the relervent SDK of my phone and through it i should make my jar and jad files. The SDK provides a bunch of tools for controlling and manipulating the mobile device. For example, the Sony Ericsson SDK provides a whole set of tools that allow you to access the phone directly such as manipulating memory, debugging on the actual device as well as directly installing software onto it. In this case, it takes a JAD and JAR file, and installs it directly onto the phones memory, basically bypassing the phones functionality. The additional advantage is that unlike the phone, it will provide you with exact reasons why it failed.

So, the steps should be:
1) Install the SDK.
2) If using Netbeans, Right click on your project and Go properties->Platform
3) Make sure that you have set the right Emulator Platform set (in my case, it is "Sony Ericsson SDK 2.5.0 for the Java(TM) ME Platform(Debug On-Device)"). From there, select the correct device type. I chose "SonyEricsson_JP-7". I could have been specific to my phone, however this seems to be a good generic choice, and it workes fine for me (You may need to find the correct compatible one for your phone).
4) Under Deploying, select "File Copy", and then pick a destination.
5) Press OK. Go back and right click on your project but this time, press deploy. You should find it will compile your JAR and JAD. From here, you have 2 installation methods:
a) Using the SDK of your phone, directly install the Midilet to your phone using the JAD and JAR files.
b) Using whatever transfer method you have handy (USB, Bluetooth or Infrared), send the JAR file to your phone. In my case, Right-clicking on the JAR and going "Send to->Bluetooth device" works fine. In some cases, if you have installed the extra software for your phone, you may have a "Send to->Usb Device->My Phone" or something. Alternatively, the PC Suite it comes with may help you here.

I got this information from the oficial sun forum site http://forums.sun.com/

1 comment:

kanishka© said...

Quite an experience. I am not into mobile development. But it seems fun. Have to think again. he he..........