Thursday, March 29, 2007

cTunes here we go live!!!

It has been a long time since I blogged, mostly because I have been very very busy both with my work and also with several "week-end projects". But all is not to be blamed on the work, I have been quite lazy too! Anyway a long time ago, perhaps over 6 months ago, I wanted to write a small application that looks like iTunes but would run on J2ME enabled phones (MIDP 2.0). I started out all excited and wrote this small application called cTunes that kind of mimics iTunes. I recently made a video from it and posted in youtube (follow this link http://www.youtube.com/watch?v=coV06ChYWJo or see below)

I also demonstrated this application at the Phoenix Java User Group on 07/12/2006 (go to this link http://www.phxjug.org/meetings.html and search Chandan Pitta). The excitement died soon after I was able to prove that phones can be as good as iTunes and yet allow you to make calls. So I did not do anything more to the application and jumped to other "week-end projects". Recently I posted a video of "newvo" on youtube, which is an application I wrote using kaa framework of freevo2. Oh by the way I am an occasional developer for Freevo and I will save the whole Freevo2, Newvo story for another day. Anyway after I posted the video, I got a few comments and the video has some honors too. So I decided to add the cTunes video and now I receive several requests for the code. So the following information is for those individuals.

I would like to make it an open source project but the application is not even half complete, so may be some day I will finish it. For all those who are asking for the application, I am not sure if it is useful to any. I mean it is a proof of concept kind of application and it requires the application to be signed for it to work on a phone. By the way, the application can run on any phone that supports MIDP 2.0 and JSR 135, JSR 75 and not just on ROKR E2. Please check your phone to see if they are supported. I tested it on Sony Ericsson W800i and a Nokia phone too (don't remember the number). Since I am a software engineer at Motorola I have a Verisign certificate that I used to sign the application and test on those phones. However I cannot distribute the signed application, so I can send an unsigned J2ME application and if you happen to have a certificate you can sign and use it.

A few things to consider.
1. Can anyone tell me where I can post the application so that everyone can download.

2. The music and photos work, but the video might not work. I have not tested it for a long time, but for the video playback I used MPlayer (yes I modified MPlayer to work with ROKR E2 and cross-compiled. It was a beautiful experience working with shared memory, threads and semaphores in C++ to make MPlayer work on the Motorola proprietary audio and video interface). I will work on the video part to make use of the video capabilities provided by J2ME (I tried to use it but it could play videos only at 15 fps and that too the video had to be encoded in 3gp format at a specific size and frame rate, but with mplayer all the problems disappeared. I can play at 25 fps and could play avi, 3gp or any format that the mplayer could support).

3. As I mentioned previously, it has to be signed for it to work. Otherwise you can install the application and change the settings from your phone to allow the application to have read permissions for files.

4. This is the permissions part that you might need to add to the JAD file and then sign it to make use of it.
MIDlet-Permissions: javax.microedition.io.Connector.file.read

5. The application should run on ROKR E2 without any modifications, but if you are trying it on a Nokia or Sony Ericsson you have to edit the JAD file and change the property from "StorageCard: file:///SD/" to "StorageCard: file:///C:/" (Nokia) or "StorageCard: file:///e:/" (Sony-Ericsson) or where ever your secondary storage card is mapped to. Don't forget the trailing slash.

6. If you somehow have passed through all the hurdles then here are some key assignments when viewing photos:
1 = rotate image
2 = move image down
3 = toggle fullscreen
4 = move image right
5 = reset all transformations
6 = move image left
7 = reflect image
8 = move image up
9 = toggle scale image to fit to screen