Upgrading an Application Using Different Languages

by BlackBerry Development Advisor ‎12-12-2012 04:37 PM - edited ‎04-21-2014 10:31 AM (4,133 Views)


This article applies to the following:

  • BlackBerry® 10


BlackBerry 10 now supports upgrading an application written in one language to another.  For example you can upgrade an Android™ application to a Cascades™ application, an Adobe® AIR® application to a BlackBerry® WebWorks™ application or any other combination.  In order to do this, you'll need to sign both applications using the same BlackBerry Code Signing Key and specify the same package name.  Below is a summary of where the package name is specified for each BlackBerry SDK.


If the package name or code signing key is different, your application upgrade could be rejected by BlackBerry®  World™.





Cascades application using the BlackBerry Native SDK


For Cascades applications, the package name is set in the bar-descriptor.xml file.  You can modify it by opening this file in the BlackBerry Native SDK, selecting the General tab and modifying the value next to Package Name as shown in the screenshot below, which uses a package name of com.example.bb10upgradetestapp.







WebWorks Applications


The package name for WebWorks applications is set in the id attributed of the widget tag of the application's config.xml file.  The code sample below shows the use of a package name of com.example.bb10upgradetestapp.


<widget xmlns="http://www.w3.org/ns/widgets" 
        version="" id="com.example.bb10upgradetestapp" xml:lang="en">




Adobe AIR Applications using the BlackBerry SDK for Adobe AIR


Adobe AIR applications set the package name in the appname-app.xml file under the id tag.  The following code sample also uses a package name of com.example.bb10upgradetestapp.






Android applications using the BlackBerry Plug-in for ADT


The package set for an Android application is used as the package name when building the application for BlackBerry.  It is set in the Package field on the Manifest tab shown when editing the AndroidManifest.xml file for your project as shown here.  The screenshot also uses com.example.bb10upgradetestapp.






AIR Application exported as an Android Application using Adobe AIR Captive Runtime


By default, when you export an AIR application from Adobe® Flash Builder® that uses the AIR Captive Runtime, "air." is prefixed to the application's package name.  This does not occur when you export BlackBerry applications.  This means if your BlackBerry application specified a package name of com.mypackage.myapp, the exported BAR file would use com.mypackage.myapp as the package name, but the exported APK would use air.com.mypackage.myapp.  This configuration will break upgrades for users of existing applications if you were to repackage that APK file as a BAR file and submit to BlackBerry World.  Please refer to this article for instructions on removing the "air." prefix.  Retaining the Original Package Name for Upgrades to AIR Applications using AIR Captive Runtime