Repacking an AIR based .apk to PlayBook .bar

This is another one of those tidbits that is mean as a FYI. It might be useful in prototyping or trying out old content without having to setup a specific project for the PlayBook.

These steps assume that you have installed the BlackBerry Tablet OS SDK in the default location of {APPLICATIONS_PATH}/Adobe Flash Builder 4/sdk/blackberry-tablet-sdk-0.9.0.

Steps to repackage an AIR based .apk to AIR PlayBook .bar application:

  • Rename your .apk to .zip
  • Unzip the .zip file, it will create a folder by the same name as your app. ie: MyApp.zip will be MyApp/
  • On the command line cd to MyApp/assets/
  • On the command line run:
    PHP:
    /Applications/Adobe\ Flash\ Builder\ 4/sdks/blackberry-tablet-sdk-0.9.0/bin/blackberry-airpackager -package MyApp.bar -installApp -launchApp META-INF/AIR/application.xml MyApp.swf assets_runtime/ icons/ -device 192.168.1.102

    Note: The assets_runtime and icons folders are specific to my application but they represent any files that need to be packaged into your application, change appropriately. The -device IP_ADDRESS needs to be changed to your simulator's ip. Also the command above is on a Mac, but it would similar on windows calling blackberry-airpackager.exe.

Thats it!

  • http://uiandtherest.com Adrian Pomilio

    Thanks, very useful. So would it be safe to assume that for the code to run on BB Playbook you would have had to stick to just an ActionScript AIR app with no Flex components? I would assume so, but just double checking.

  • http://www.renaun.com Renaun Erickson

    You can use Flex on Android or PlayBook. Having said that the Flex SDK codenamed Hero, which is in preview on labs.adobe.com, is the best option when playing with Flex on mobile. Flex Hero provides mobile components and a mobile skin that is optimized for devices.

  • http://uiandtherest.com Adrian Pomilio

    So I don’t have to use the BlackBerry SDK, but rather package it as a .bar file to work on BB? I am using Hero. Very cool, solves some issues.

  • http://www.renaun.com Renaun Erickson

    The packaging of the .bar requires tools from the BlackBerry Tablet OS SDK. The blackberry-airpackager in the bin folder.

  • http://www.randytroppmann.com/2010/11/17/adobe-air-and-blackberry-playbook/ Randy Troppmann » Adobe AIR and BlackBerry PlayBook

    [...] http://us.blackberry.com/developers/appworld/distribution.jsp http://renaun.com/blog/2010/11/repacking-an-air-based-apk-to-playbook-bar/ Categories: Flash development Tags: Comments (0) Trackbacks (0) Leave a comment [...]

  • http://uiandtherest.com Adrian Pomilio

    Thanks, I miss posted. I meant using Flex Hero components vs BB only components that are in their sdk. I understand the part of using the BB SDK, have been enjoying it for a little while now. Just didn’t realize I could use Flex Hero components, thought I was limited to what the BB SDK offered.

    Thanks for the post and your responses.

  • http://www.renaun.com Renaun Erickson

    cool glad you figured that out. Here is an article on a Hero Mobile example app on the PlayBook. http://www.adobe.com/devnet/devices/articles/blackberry_tablet_os_sdk.html

  • http://blog.everythingflex.com/2010/11/18/flex-based-air-on-playbook-tutorial/ Flex Based AIR on PlayBook – tutorial | EverythingFlex: Flex & AIR

    [...] I wrote them myself for Android and just recompiled to a .bar file using the instructions that Renaun posted on his [...]

  • http://blog.everythingflex.com Rich Tretola

    Tour de Mobile Flex compiled to PlayBook. Thanks Renaun!
    http://blog.everythingflex.com/2010/11/18/flex-based-air-on-playbook-tutorial/

  • http://flexsamples.com Jason Graham

    I followed the directions you showed here and having a few issues. I am using Flex Builder Burrito and Flex Hero SDK.

    I removed all the android specific entries from the air descriptor file for my application.

    When I try to run the command line to build the .bar file, I get this error.

    Any ideas on what or where I set a Package-Version to?

    /Applications/Burrito/Adobe\ Flash\ Builder\ Burrito/sdks/blackberry-tablet-sdk-0.9.0/bin/blackberry-airpackager -package MyMobileApp.bar -installApp -launchApp META-INF/AIR/application.xml MyMobileApp.swf -device 192.168.1.36

    Using default icon: /Applications/Burrito/Adobe Flash Builder Burrito/sdks/blackberry-tablet-sdk-0.9.0/bin/../samples/icons/blackberry-tablet-default-icon.png

    Invalid manifest file /var/folders/EV/EVX86d-GExSaaOTq0AmdmU+++TI/-Tmp-/bar2239407493415422066.MF.
    Invalid value ’0.0.0.0′ for Package-Version.

  • http://www.renaun.com Renaun Erickson

    Yes, the simple fix is the versionNumber can’t be 0 based. Make it 1.0.0 its a quirk in the BlackBerry packager script.

  • http://renaun.com/blog/2010/12/browse-files-on-playbook/ @renaun posts: Browse Files on PlayBook

    [...] The 2nd method is to use my old post of repackaging .apk files to .bar files found here. [...]

  • http://www.funnygarbage.com/ Colin Holgate

    Curiously, the version cannot be 1.0 either. Setting it to be 1.0.0 did let it package ok.