Android, Blackberry, and Java ME

July 4, 2009Andrew 1 Comment »

At my coop job this summer I’ve had the pleasure of developing mobile applications for the Android, Blackberry, and Symbian platforms.  The contrast between the three from a developer’s point of view is striking, especially for me because I ported an application between all three.

The first platform I was introduced to was Google’s Android.  Android applications are written in Java.  Blackberry and Symbian are written in Java ME. What’s the difference?  I’ll illustrate with a few problems I experienced and the solutions I used.

Problem 1: I need to remove HTML tags from a string.

Android: I’ll either use a simple regular expression or the tag remover method that comes with Android.

Java ME: I’ll either write a crappy HTML remover by hand or find and install a 3rd party regex engine.

Problem 2: I need a GUI element that smoothly animates between a bunch of pictures. (A picture gallery)

Android: I’ll use the built in gallery widget.

Java ME: I’ll spend days writing my own gallery widget at a low level or pay to use a 3rd party GUI toolkit like J2ME Polish.

Problem 3: I need to format the output of some floating point numbers to 2 digits after the decimal point (ie, money)

Android: I’ll use the String Formatter class that comes with Java.

Java ME: I’ll be shocked that simple output formating that has been available since C was released is not available in Java ME. I will  then I’ll spend 90 minutes formatting my output with if statements.

Problem 4: I need to sort an array of objects.

Android: I’ll have the objects implement Comparitor then I’ll use the built in Array sorting method.

Java ME: I jump off a cliff.

Problem 5: I need to store some user data

Android: I’ll use the built in SQLite DB or, for simple app settings, I’ll use a persistence dictionary.

Java ME: I overdose on cocaine.

You get the picture.

One response to this entry

Join the discussion