Port your Adobe AIR app

If you develop apps using Adobe AIR, you can repackage your existing BlackBerry 10 Adobe AIR apps as Android apps. Then you can use our repackaging tools to port those Android apps to BlackBerry 10. The BlackBerry Runtime for Android apps is available on the BlackBerry 10 OS version 10.2.1 or later.

The BlackBerry/QNX Native Extensions that are supported in the BlackBerry 10 SDK for Adobe AIR are not available in the Google Android SDK.

If your app uses Adobe AIR 3.7 and Adobe Flex 4.5 or earlier, you must include the captive runtime in your app.

As of Adobe AIR 3.8 and Adobe Flex 4.6, the Adobe AIR captive runtime is packaged in the .apk file by default.

Removing the air. prefix from your app Package-Name

You must use the same signing key and package name when you want to update one of your existing apps on BlackBerry World. Using the same signing key and package name avoids having your update rejected by the BlackBerry World portal.

For more information on this error, see Error "File bundle (your_name) has been rejected.".

Repackaging an Adobe AIR app often causes an air. prefix to be added to its .bar file Package-Name attribute. The air. prefix makes it appear as though your update is a new app. The reason your app appears to be a new app is because it has a different Package-Name than the original app, which would not have had the air. prefix in it.

When an app with a new signing key or Package-Name is posted to BlackBerry World, it's treated by the system as an entirely new app. This issue can cause problems with an app update because the seemingly new app appears on users devices with a duplicate icon of the original app. The duplicate icon makes it appear to users that the app has been installed twice. Also, the seemingly new app does not have access to any data that the original app had previously saved.

To avoid this issue, the air. prefix must be removed from the Package-Name attribute of your app's .bar file when repackaging your app for BlackBerry World. When the air. prefix has been removed the app continues to have the same name as the original that was registered with BlackBerry World and can be updated without issue.

Before you begin

  1. Download the latest Adobe AIR SDK.
  2. Extract the Adobe AIR SDK to a new folder on your computer.
  3. Create an environment variable called AIR_NOANDROIDFLAIR, set its value to true. This environment variable helps you control when the air. prefix is added to your repackaged Adobe AIR files.

The value of the AIR_NOANDROIDFLAIR variable is case-sensitive, therefore the variable name must all be in uppercase, and its value of true must all be in lowercase.

Remove the AIR_NOANDROIDFLAIR environment variable, or set it to false before you repackage an update to an existing Adobe AIR app for submission to the Google or Apple app stores. Performing one of the above actions ensures that the air. prefix is present in those updates.

After you've completed the above instructions, you are ready to export your Adobe AIR app as an .apk file, which can then be repackaged as a .bar file.

If you are using FDT PowerFlasher, proceed to Exporting an .apk file with FDT PowerFlasher.

Exporting an .apk file with Adobe Flash Builder

‹ Top

Select the instructions below that apply to the specific version of the Adobe AIR SDK that you're using. These instructions guide you through the process of removing the air. prefix from an app update before it's repackaged as a .bar file, and submitted to BlackBerry World.

Using Flash Builder with Adobe AIR SDK before 3.8

The steps in this section should be used only when you want to continue using a version of the Adobe AIR SDK before version 3.8 in Flash Builder. The compilation of your SWF files can still be done using your existing version of the Adobe AIR SDK.

  1. Start Flash Builder.
  2. Right-click your project in Flash Builder, select Export.
  3. Expand the Flash Builder folder and select Release Build.Screen showing a step to begin exporting a release build.
  4. Click Next.
  5. In the Export Release Build dialog box, in the Target platforms section, select Google Android as the only Target Platform.
  6. In the Export section, select Keep bin-release-temp folder.A screen displaying the selections to make for exporting a release build.
  7. Click Next.
  8. Click Cancel to end the process. The process is stopped because only the files that are created in the bin-release-temp folder that is displayed in your Adobe AIR project are required. The bin-release-temp folder contains the -app.xml, bar-descriptor.xml, and the .swf files for your app.
  9. Copy the above files from the bin-release-temp folder to a new folder on your computer, and note the new folder's location.
  10. Open a command prompt, and navigate to the new folder that you created in the previous step.
  11. Update the following command parameters so they match your paths, password, and app name.
    java.exe -jar "PATH_WHERE_YOU_UNZIPPED_LATEST_AIR_SDK\lib\adt.jar"
    -package -target apk-captive-runtime -storetype pkcs12 
    -keystore "PATH_TO_YOUR\AndroidCert.p12" 
    -storepass yourAndroidCertPassword YourApp.apk YourApp-app.xml 
    YourApp.swf bar-descriptor.xml
    
  12. Open a command prompt screen, enter the updated command from above into the command prompt. The above command creates an .apk file for your Adobe AIR app.

Proceed to Repackage your .apk file for BlackBerry 10.

Using Flash Builder with Adobe AIR SDK 3.8 or later

  1. Start Flash Builder.
  2. Right click on your project in Flash Builder, click Export.
  3. Expand the Flash Builder folder and select Release Build.Screen showing a step to begin exporting a release build.
  4. Click Next.
  5. In the Export Release Build dialog box, in the Target platforms section, select Google Android as the only Target Platform.
  6. In the Export section, select Keep bin-release-temp folder.A screen displaying the selections to make for exporting a release build.
  7. Select Keep bin-release-temp folder.
  8. Click Next.
  9. Select Export app with captive runtime.
  10. Click Finish.

Exporting an .apk file with FDT PowerFlasher

‹ Top

To use the FDT IDE to export your Adobe AIR app as an .apk file:

  1. Open your app in FDT PowerFlasher.
  2. Choose Project > Properties.
    A screen displaying the Properties selection in the Project menu.
  3. In the Properties dialog box, from the left navigation menu, select Android.
  4. Select the Build tab.A screen displaying the Build tab in the Properties dialog box.
  5. Select or create your app descriptor file, and your app's SWF file.
  6. Select the Deploy tab.
  7. In Application Store settings, select Export app with captive runtime.
  8. In Export Application, set the Deploy Location field. This value is the path to where you want to save the .apk file that's created.
  9. Click Export Application.A screen displaying the Deploy tab in the Properties menu.
  10. Click OK to close the dialog box.

When FDT has finished compiling and repackaging your app as an .apk file, a dialog box is displayed telling you that the operation was successful.

Repackage your .apk file for BlackBerry 10

‹ Top

Your app's .apk file must be repackaged as a .bar file before it can run on the BlackBerry 10 OS. Your app's .apk file must also be checked to verify that the air. prefix has been removed. Performing these actions prepares your app for submission to the BlackBerry World portal, and ensures that it can be updated there when needed.

Follow these instructions to repackage your .apk file as a .bar file, and check for the air. prefix:

  1. Install an app repackaging tool to repackage your .apk file as a .bar file.
  2. Open your app's new .bar file with the same tool you used to create it. For example, Android Studio.
  3. Verify that the Package-Name attribute in the \META-INF\manifest.mf file does not contain the air. prefix.

When you resubmit your app to BlackBerry World, set the value of the minimum supported BlackBerry 10 OS to 10.2.1. This step is required because the captive runtime uses native code that's supported in the BlackBerry Runtime for Android apps as of BlackBerry 10 OS version 10.2.1.



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus