Android apps porting to BlackBerry PlayBook. It's easy.


SDK Version: 
M3

At the begin of February 2012 I’ve tested the BlackBerry Runtime for Android apps Beta which have shown up in end of 2011 to port our Bugzi application from Android to BlackBerry platform. The guys at RIM promise it’s easy. Let’s see, is it really easy?

At first we can choose three method to port Android applications: Eclipse plug-in, Online tool, and Command-line tools. I use the Eclipse plug-in, because we are programming in eclipse so it’s a clean choice. The little changes in code to make apps compatible with BlackBerry (it has some unsupported features and APIs from android. see later) is more easier with it, and you can test, and debug the code directly with BlackBerry PlayBook simulator, or real hardware.

Before installing the plug-in you must look after the system requirements. (let’s see: https://bdsc.webapps.blackberry.com/android/documentation/sys_requiremen...). The weighty points are: Eclipse IDE version 3.7, ADT plug-in for Eclipse version 12.0.0 at minimum, Android SDK API 10 at minimum. If your computer, and software on it complete these requirements, you can start the installation.

You can follow a steps by step installation at “Installing the Plug-in” sub menu of “Plug-in repackaging tool” menu of webpage above. (There is preinstallation tasks if you’ve problems with software requirements) If you finish that fine, you can see the a BlackBerry menu in the window -> preferences in eclipse. After that you must get signing keys from RIM, without these you can’t install, and run your ported apps. So you must register your e-mail address to their system, then you get your keys, usually it takes one day, but my keys came in couple of hours. Visit and take the steps at “Signing keys and creating a developer certificate” sub menu at menu above. When you’ve the signing keys you can make a debug token that must install on your simulator or real PlayBook for next steps, go to the “Configure and upload debug token” sub menu.

Now you can start using the plug-in, at first if you haven’t got a real PlayBook hardware must set up a simulator which can make run your application. Go to “set up your testing environment” sub menu at “Getting started” menu on BlackBerry development page above (https://bdsc.webapps.blackberry.com/android/documentation/whitelisting_y...). If you have a real PlayBook you must connect it to your computer with wifi network, or if you are using the simulator follow the steps on webpage to set it up.

Then you are ready to port your application to BlackBerry, but you must check the “API support” menu in BlackBerry developer page (https://bdsc.webapps.blackberry.com/android/apisupport). There are a lot of unsupported features, and API things. If one or more of these are in your app, you must modify your code. For example one of most common thing in an android app is the android market API, it must be deleted from apps before you can port it.

After correcting your app go to your package manager in eclipse right click on the project name you want to port. In the bottom of menu you can find a “BlackBerry tools” point it, in sub menu that is displayed click on “Add BlackBerry Nature to project” the project is prepared to run on BlackBerry PlayBook. To run the project go to “Run as -> Run -> BlackBerry Android launch” then if everything is o.k. your project is running on your device or simulator.

I use simulator to test Bugzi project. My opinion is the simulator isn’t the best because there are some bugs yet, for example where in android app has thread, in the display of simulator brakes down, after the thread is finished work the display is good again.

Some conclusion: The port of applications from android to BlackBerry is really easy. But the ported application can run only BlackBerry PlayBook, and the phones that will use BlackBerry OS 10, so it limits the usage. Some android applications can’t be ported because they are using unsupported features, and APIs.

For more information about the porting visit the BlackBerry Runtime for Android apps official web page http://developer.blackberry.com/android.