Wednesday, February 29, 2012

How to run Android applications on the BlackBerry PlayBook tablet (.apk to .bar)

Hi Guys!

  In this blog we'll see how we can run and use the Android application into the Blackberry Playbook tablet. we can use the BlackBerry Runtime for Android apps to run Android 2.3.3 platform applications on the BlackBerry PlayBook tablet. To use the runtime, you must first repackage your Android applications to BAR file format, which is the compatible file format required for an application to run on the BlackBerry Tablet OS

 Developer can use three tools to repackage android application to BAR file format and also to check the compatibility of application during run time on the BlackBerry Tablet OS. Some of the APIs in the Android SDK may not be supported, or only partially supported by the BlackBerry Runtime for Android apps.The three tools are:

Repackaging tool
Description
BlackBerry Plug-in for Android Development Tools
This tool allows you to develop, verify for compatibility, repackage it, and sign your app for the BlackBerry PlayBook using the Eclipse IDE.
BlackBerry Packager for Android apps
This tool is a simple web interface that allows you to verify, repackage, and sign your app without downloading additional software. Point the tool to your Android APK file and the Android SDK on your computer, and the tool will do the rest, with just few mouse clicks required from you.
Command-line tools for Android apps
The tool or the SDK is a set of command-line utilities that do everything the other tools do, just from the command line.
Get started with the command line tools.

Minimal requirement :

Item
Requirement
Hardware
Memory of 4 GB RAM or more
Monitor resolution of 1024 x 768 or higher
Intel® Pentium® 4 or AMD Athlon™ 2 GHz (or faster)
1 GB (or more) available hard disk space
Software
Eclipse version 3.7 (Cocoa 32 for Mac OS X)
ADT plug-in for Eclipse version 12.0.0 at minimum (recommended 16.0.1)
Android 2.3.3 platform API 10
Java Runtime Environment 1.6
Operating system
Windows® XP SP3, Windows Vista® Ultimate or Enterprise, Windows® 7
Mac OS X 10.6 Snow Leopard, Mac OS X 10.7 Lion
Virtual environment
VMware Player to run the BlackBerry Tablet Simulator on Windows
VMware Fusion to run the BlackBerry Tablet Simulator on Mac OS
Before install and use the BlackBerry Plug-in for Android Development Tools, users must have installed and configured ADT plug-in for Eclipse rev12 (or newer) and Android 2.3.3 platform, API 10 in Eclipse. Users also need JDK 5 or JDK 6 (JRE alone is not sufficient) installed on your system. 
  
Installation Process:

Install Eclipse
Download and install Eclipse. To download Eclipse, visit http://www.eclipse.org/downloads/packages/eclipse-classic-37/indigor.
If you are using a Mac, download Eclipse for Mac OS X (Cocoa 32).
Install the Android SDK
The command line and plug-in repackaging tools require that you have the Android SDK installed on your computer. If you don't have the Android SDK on your computer, you must install it.
  1. To download the Android SDK, visit http://developer.android.com/sdk/index.html and download the android-sdk_r16-windows.zip file.
  2. Extract the file to your preferred location. The folder that you extract the contents of the .zip file to is the Android SDK installation folder. When using the plug-in repackaging tool you must reference the path to this folder. To simplify this path reference, define an environment variable for the installation folder.
  3. Open the Android SDK and AVD Manager. In the Android SDK installation folder, run the android-sdk-windows/SDK Manager.exe file.
  4. In the Android SDK and AVD Manager, click Available packages.
  5. In the Packages available for download section, select the following:
    • Android SDK platform-tools, revision 16
    • SDK platform Android 2.3.3, API 10
  6. Click Install Selected and accept any license agreements to install the selected packages.
  7. Restart your computer.
Install the ADT Plug-in for Eclipse
To download the ADT plug-in, visit: http://developer.android.com/sdk/eclipse-adt.html.

Install the BlackBerry Plug-in for Android Development Tools:

Before you begin, make sure you have installed Eclipse 3.7 and ADT plug-in for Eclipse 12.0.0 or Eclipse IDE version 3.6 and ADT plug-in for Eclipse 11.0.0.
You must also install the SDK Platform Android 2.3.3, API 10, revision 2 in Eclipse. To download, on the Window menu, click Android SDK and AVD Manager.

  1. In Eclipse, on the Help menu, click Install New Software > Add.
  2. In the Name field, enter a name for the plug-in.
  3. In the the Location field, enter the URL of the update site for the plug-in. The URL of the update site is https://bdsc.webapps.blackberry.com/android/downloads/eclipseplugin/.
  4. Click OK.
  5. In the Install window, in the Name field, select the BlackBerry Plug-in for Android Apps check box, and also select the check boxes for the items under it.
  6. Click Next.
  7. Complete the instructions in the Review Licenses window. Click Finish.
After you install the plug-in, you must specify the location of the BlackBerry Tools SDK in the plug-in preferences. To specify the location, in Eclipse, on the Window menu, click Preferences > BlackBerry > BlackBerry Tools SDK and specify the path in the SDK path field. 

5 steps need to follow:
 we can use the BlackBerry Plug-in for Android Development Tools to check our Android application package for compatibility, repackage it in the .bar file format, test it and finally sign the application which is required to distribute our application to the BlackBerry App World storefront. The following workflow shows the steps required to repackage your Android application for the BlackBerry Tablet OS.
 

Attention required before repackaged Android applications: 

The BlackBerry Runtime for Android Apps allows users to run Android applications that were repackaged for use on the BlackBerry PlayBook tablet. The following information outlines the differences that users can expect to see in the UI after repackage of the application.
UI characteristic
What users can expect
Navigation
Since the BlackBerry PlayBook tablet does not have a Back key, users must tap the Back button that appears at the bottom of the screen or use the Back gesture to display the previous screen. To use the Back gesture, users swipe from the bottom of the screen at a 45 degree angle toward the left side of the screen.
Note: A navigation bar with a Back button appears at the bottom of most applications. For applications that use full screen mode (for example, games) users can swipe down from the top of the screen to display the navigation bar.
Application menu
Since the BlackBerry PlayBook tablet does not have a Menu key, users must swipe down from the top of the screen to display the application menu.
Notifications
Application notifications, including the status of activities that are occurring in the background (for example, music that is playing or files that are downloading), appear when users tap the exclamation mark icon in the top-left corner of the home screen.
Scaling
If you created your application for a smartphone, UI components will be scaled up for the BlackBerry PlayBook tablet. If you created your application for a tablet with a screen size that is larger than the screen size of the BlackBerry PlayBook tablet (7 inches), then UI components will be scaled down.
If users want to optimize the layout of  UI,  can make adjustments to the UI components based on the following characteristics of the BlackBerry PlayBook tablet:
  • Application icon size: 86 x 86 pixels
  • Screen dimensions: 1024 x 600 pixels (7" tablet-size of Android)
  • Pixels per inch (PPI): 169.3
  • Image bit size: 32
  • Image file type: .png
 Publish app:
Once app is signed, we can add and publish it on the BlackBerry App World storefront by following the instructions available here
*our applications must target BlackBerry PlayBook OS 2.0 (or later) for them to be considered for approval.

Also, users can get the details of "unsupported features and APIs" of android applications into the Blackberry Run-time here.

1 comment: