Deploying & testing Android Apps on the Blackberry Playbook
A while ago Blackberry announced the Developer Outreach program for Android developers. The idea is simple: port your Android app to the Blackberry Playbook, publish it in AppWorld before February 13 and receive a free Playbook.
Our Clifford App is already in the market so why not porting it over to a new platform, finally add tablet support and receive a Playbook for further evaluation.
Unfortunately, things got a little complicated during the porting. Here are some steps to remember:
- During my test, the Blackberry Eclipse Plugin did not work. I just used the Command Line tools + ant
- Download the tools (command line) and the Simulator (basically a VMWARE Player image) from https://bdsc.webapps.blackberry.com/android/tool/
- In my setup, the tools reside in ~/bin/blackberry.tools.SDK/
- To convert the Android apk into the playbooks bar format, I used the command line tools:
- Make sure your Android App can be built using `ant release`. Also make sure you SIGN it in this step, for example with your debug key.
- Convert the apk to bar
- Deploy the bar on the device.
A helper script could look like this:
# ant clean release # ~/bin/blackberry.tools.SDK/bin/apk2bar ~/git/asia.ivity.qifu.android/asia.ivity.qifu.bb/bin/Clifford-release.apk # ~/bin/blackberry.tools.SDK/bin/batchbar-deploy bin/ 192.168.35.172
192.168.35.172 is the IP of the playbook simulator, yours might be different.
Reading Android logcat output from the Playbook
Android debugging is usually done using logcat. To use it, you need to enable a debugging bridge first:
Then (in another terminal) connect the playbook using a networked adb connection:
adb connect 192.168.35.172 adb -s 192.168.35.172:5555 logcat
Remember not to use Google Maps on your blackberry port
The Android runtime in the Playbook does not support Google Maps libraries. Hence, you cannot use Google Maps within your App. Be sure to check out OpenStreetMap.
To solve this, I moved central logic of my App into a core library, while having 2 separate apps that simply use the logic and contain config switches to enable/disable certain features:
This kind of logic also allows you to put separate artwork files into your blackberry project which isn’t needed elsewhere.
After running through all of these steps, I was happy to finally see the App running on the Playbook, here are some screenshots:
Unfortunately the Playbook simulator behaves weird in many ways. Items get drawn too many times, and several glitches do exist when testing the App. Hope this is different on the real device.
Have fun porting your App to the Playbook.