Saturday, February 24, 2007

Experiments with development on the Nokia 6265

I recently got myself the Nokia 6265 CDMA phone. It is a nice phone and I intend to write a reveiw of it in my other blog one of these days. The phone supports the Nokia's Series 40 3rd Edition development platform and I am trying out developing Java Micro Edition applications for it. I hit some interesting problems and found some solutions - I am trying to chronicle them here.

Firstly, I have never done development for a mobile phone so I had to start from scratch. I wanted to know what I could do with my phone and Nokia had quite a lot of information. They have these videos of their Eclipse integration called Carbide.j which seemed interesting although a little painful (being a graphical modeling like UI and all).

I found the Nokia site a tad vague about what exactly is needed for what but eventually I figured I needed the Nokia Series 40 3rd Edition SDK. Now, Nokia has 3rd Edition Feature Pack 1 and 3rd Edition Feature Pack 2. It wasn't very clear to me which one would work and I chose the base version and thankfully that is the right one. Only one phone so far supports Feature pack 1 as far as I know.

After installing the SDK, the documentation said that I need a JDK, Eclipse, NDS for Java ME, and then I should install SDK. Did I mention that the Nokia site is slightly confusing? :-) I went off in search for NDS and found out that it is now renamed to Carbide.j and is a 135+ MB download. While it was downloading, I thought I would try and locate J2ME support in IntelliJ Idea.

IntelliJ Idea J2ME integration

Now, this is the nice part.

I went through the IntelliJ Idea documentation which described how to set up a J2ME module and the only part that looked a little hard was the Mobile JDK configuration. I crossed my fingers and pointed at the Nokia installation and IntelliJ found all it needed - bootclasspath, javadocs, emulator, etc. It is really sweet!!

Everything works out of the box - compile works great, and when you run it runs against the Nokia emulator. Even debugging is seamlessly supported!! Fantastic - and no need for Eclipse or the Eclipse plugins! Needless to say I cancelled my Carbide.j download. You do not need it for development on the Nokia phones. I hope the Nokia guys put this on their documentation.

One strange problem so far (in my HelloWorld application) has been that the jad and jar generated by IntelliJ is not working on my phone or on the emulator. It fails with an error message saying "Application invalid. Delete?". There is a temporary file that Idea is generating which seems to work. I think I am missing something here. I would appreciate any help.


6 comments:

Geoffrey Wiseman said...

How are you plannin' on getting the app to the phone? Do you have the link cable?

Sachin said...

I have been using the infrared connection. The nice thing is if you transfer the jar and jad files the phone recognizes that it is an application and sets it up. I could also use the Nokia PC Suite but that involves more steps and I have been having intermittent connectivity issues with it.

unknown said...

Its funny how most mobile phone api's need an IDE to develop an app. I can't understand why so many people become completely handicap without IDEs. We were developing an application on the Motorola phones and they need IDE too. I think NetBeans plays well with them. However, I found Sony Ericsson much better. They don't need any particular tool, have a good API and their documentation is also decent.

Sachin said...

I am pretty sure you don't require an IDE for development with Nokia. However, the nice thing about IDEs (and I am biased because I have been involved mostly in the development of IDEs) is that they are meant to automate many things. You can completely not use IDEs - and lots of good developers do that. However, with a good IDE you should see a substantial improvement in productivity when it takes care of repititive, automated tasks. Also, in this case - my mode of interaction has remained unchanged - all the actions to debug, compile, run are the same as for Java SE development which makes it much faster to get going.

unknown said...

I agree, a good IDE will definitely increase productivity provided he/she is already good at the task for which they are going to use the IDE. Otherwise its like a walking cane, they simply crash without it.

In the last few months I started working with few guys who were completely helpless w/o IDEs. Even for the most simplest tasks they need one. Its so annoying to work with such people. Since for any task they get they will start by either installing a new IDE / an IDE plugin, or if there isn't one already then experimenting with the one that will fit the best. By the time they actually start solving the problem at hand they've spent so much time that the advantages of using an IDE are all lost. And the sad part is they are so dependent on their "IDE's" that they have very little knowledge of the underlying processes like understanding how a build script works. Don't even get me started with those "Netbeans" guys :-).

Anonymous said...

Note being able to deploy the application on the phone!!

I have reported this problem to JetBrains IntelliJ development team.
After inspection, the JAD file settings appears to be incorrect.
The MIDlet-1 line is missing a class to start with.
There are other issues concerning importing optional packages.
For more details I will be happy to help...
Ali Kattan - Java Developer
kattan@mlabs.com