« DIY Cellphone | Main | Going to school to study music is expensive »

Camera Code

ferris_wheel.jpg

So, you wanna develop in Java for your Nextel camera phone? Let's say it's something simple like a simple snapshot program, much like Jonathan Knudsen's early tutorial: Taking Pictures with MMAPI. There are a bunch of particulars of the current crop of Nextel iDEN phones to consider, and the best source for that info is currently available at the iDEN developer site, in the form of the "Developer Guide 2005".

There's a lot of sample code out there, even in the examples above, to get you started. Although the i830 emulator claims to be able to use a webcam to provide functionality in the emulator, I have never been able to get it to work, nor find any information about how to get it to work.

However, I wanted to document just one aspect: how to get the app on the phone to test it. First of all, just to test the app on your phone, you'll need to sign it. Why? Because by default the phone will require explicit user permission to access the getSnapshot method -- thus if you don't sign the MIDlet, it will pause the MIDlet to ask permission, then restart, making for an awful lot of coding specific to handling the pause to get to see your app to work. Luckily most of the iDEN emulators and the iDEN J2ME 2.0 SDK include a tool to temporarily sign your MIDlet for 48 hours.

Here's how you do it:

1) Go to the bin directory in your iDEN SDK directory. For me, this was C:\program files\motorola\iDen SDK for J2ME (MIDP 2_0)\bin\.

2) In this directory you'll find a batch file named util.bat. Run it! If it doesn't run, that's probably because the keytool accessory isn't in your PATH. Typically this tool is in the bin directory of your JDK or JRE install. Add this to your path (i.e. To set the system path under Windows NT, 2000, XP, right click on My Computer and go to properties. Click advanced, then environment variables. From here, go to the system variables window and click path, and then add the full path to your JDK or JRE bin directory. Notice that the directories are separated by semi colons).

3) Once you run utils you'll see a little application that can do a few things for you. All I care about now is the "Sign Midlet Suite" button. Hit that.

4) Use domain "OPA". Enter the IMEI from your phone -- I found that the full IMEI from my phone was one number longer than the numbers the app would accept, but I found that removing the last number in my IMEI (which was a 0) was enough to make it work.

Okay, so that'll do you enough to build and debug a camera app on your Nextel phone. Lovely. It would be nice if the emulator worked, but this is better than nothing, right? Now that you've got it working well, the next step is certifying the code then distributing. Well, those are two decidedly non-trivial steps.

To have your MIDlet code certified you'll have to get a code-signing certificate from someone like Thawte or Verisign. And they require:

A. Valid Business License or Business Registration document

B. Articles of Incorporation or Certificate of Incorporation

C. Articles of Organization or Formation

D. DBA (Doing Business As), Fictitious Business Name, Trade Name, or Assumed Name registration

F. Charter Documentation (For Banks, Universities and Government Agencies)

Uhh, crap. None of the above match up for me, some little individual developer without a commercial entity to support. Besides, it's about a $400 cost to get the little digital ID, so that's a bit much for a guy who's mostly interested in giving applications away.

Anyway, there's always the hurdle that even if I get a DBA from the state of New Jersey, buy the certificate from Verisign, I would still need to get approved by Nextel as a certified partner in order to be allowed to access camera features without having to ask for permission (perhaps at all, perhaps every time...I'm not sure). Even getting that kind of buy-in from Nextel is not a given -- as the stuff I want to build with the camera are mostly software features that I don't want to charge for. That kind of flies in the face of any credible business model, including the need at Nextel to profit off of any software delivered through their networks.

So, there you have it. Some concrete advice to get a camera app on your phone, but still some hurdles left to overcome -- not technical, but perhaps all the more daunting. Let me know if you have any feedback on issues like the MMAPI emulator or the whole code-signing/certification process.

Posted by juechi at 9:18 PM