The joys of mobile development

Posted on Thu 04 December 2008

Currently working on taking pictures with J2ME phones, I banged my head a large part of this afternoon against a SonyEricsson phone that "refused" to take a picture for really unexpected reasons. Also, other applications on the same phone were able to take pictures but not mine. Why, oh why?

I finally did what I should have done right in the beginning: copy/paste the exception message in Google and see what comes up. And here is the answer...

What's happening is that the phone allows to start an application directly after download, when the web browser is still running. In that case, the browser still runs in the background, and the phone cannot allocate enough contiguous memory to capture the picture, and fails! And I spent the afternoon changing the code, downloading new versions on the phone, and starting these new versions directly from the browser...

The solution? Well, don't try to take pictures when the application is started from the browser. I now have to include an ugly hack in the code to detect this situation and display a friendly warning to the user.

Ah, the joys of mobile development...



(M)Apple and the Simpsons

Mario Kart is alive!