Wednesday, January 18, 2006

Blackberry Woes

RIM blackberry can be pretty troublesome when it comes to deploying J2ME apps. First of all they have the custom .alx and .cod files instead of the standard .jad and .jar files. These need to be generated using the RIM supplied tools and IDE (which is not Eclipse based!) However the device will automatically do the conversion if you use OTA deployment. Then there is the weird blackberry form factor - very good for email, but sucks for J2ME developers. Well.. unless you are maintaining blackberry specific versions. I think the screens on the newer 710x series and 8700 series are much better when compared to the 7xxx ones.

Even bigger pain is the connectivity, especially if your app need secure connections (https/TLS, SSL). Given that the J2ME support for HTTP spec is only partial (lack of "official" cookie support, DELETE, PUT methods, 302 redirect response handling etc), RIM makes it even more difficult with their custom connectivity options. First of all, if you are an enterprise customer, you are almost certain to have Blackberry Enterprise Server (BES) enabled. In that case all your connections by default go into your corporate intranet via BES and in order to connect to the outside world, you need Mobile Data Service (MDS) enabled within BES! Sometimes enterprise policies might not allow enabling MDS service altogether or might be restricted. Even if MDS is enabled, it might do stuff like handling redirect and cookie handling on its own - which actually might impact the way your application is designed to work. (I have seen at least the MDS simulator behaving like this). Now if you are enterprise customer and if you don’t have MDS enabled, you are basically dependent on the carrier's support for WAP gateway/proxy or direct TCP access. If your app needs direct connection and cannot use the WAP gateway due to security reasons (WAP gap), you almost have to break the app's portability by having to append an "invalid" (it uses a ";" instead of "?" Or "&") parameter to your URLs while opening the connection! For e.g.: https://myserver.com/myapp?myparam=true;deviceside=true. (Now if you think that's weird, you should see the URL for the WAP proxy!!!) . The direct connection would work only if it is supported by the carrier (Check this link for details on carrier support and config info - very useful). Anyways, your app can still be portable, by adding the extra stuff only for blackberry devices - thanks to the "microedition.platform" system property.

For non-enterprise customers RIM provides an additional service called Blackberry internet service (which is nothing but a publicly hosted BES). However the access via BIS is open only to browsers - so far. The claim is that BIS shields the connectivity from any carrier specific configuration that needs to be set on the device (APN settings etc) which is true, (the BIS settings could be specified programmatically, again non standard I suspect) and might be useful especially when you are roaming. Also there is plenty of other custom APIs that RIM provides for encryption, XML manipulation and UI. However accesses to some of these are restricted only to apps signed with RIM certs - which is not free! Interesting stuff really, but I would rather wait for the RIM-NTP patent tussle to settle down before I dig in into those!