📜 ⬆️ ⬇️

Porting Android apps to BlackBerry 10

On January 30, Research In Motion introduced smartphones on the BlackBerry 10 OS. The applications in the BlackBerry App World are still significantly smaller than in Google Play or the App Store, for example. You can manage to occupy a niche by releasing a version of your wonderful application for this OS. Moreover, it does not require much effort.

So, as it becomes clear from the information for developers , there are several ways to create applications for BlackBerry 10:

There are also several ways to turn an Android application into a BlackBerry version: using re-packaging tools, repacking an existing apk, or using the Android application source code for a more thoughtful and thorough porting and then building under BlackBerry using the BlackBerry Native SDK. Consider the first option, as the fastest and easiest.


')

Porting


First, install the Command-line tools . Of course, you can do with the online tool, but every time you press the buttons in the browser is not very convenient. You can save yourself from the torment by writing a couple of bat-files using the tools from the above-mentioned Command-line tools. By the way, in addition to using console utilities or online tools, there is also the opportunity to use the appropriate plug-in for Eclipse.

We collect the apk-file and run it through the verifier, which will tell us what is wrong with the application. Run:
apk2barVerifier <input.apk>
The output of the utility will look something like this:
D:\projects\tcs\mb_client_android\out\artifacts>apk2barVerifier mib_release_signed.apk

D:\projects\tcs\mb_client_android\out\artifacts>set LIB=C:\soft\blackberry\CommandLineTools_1.5\blackberry.tools.SDK\bin\\..\lib

D:\projects\tcs\mb_client_android\out\artifacts>java -Xmx512M -cp "C:\soft\blackberry\CommandLineTools_1.5\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\soft\blackberry\Comma
ndLineTools_1.5\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2BarVerifier mib_release_signed.apk
Apk2Bar /Verifier version 1.5.0
Research In Motion Ltd ? 2012 All rights reserved.
[mib_release_signed.apk]:(res/drawable-hdpi/logo_launcher.png) found an alternate icon with better size:impact=1
[mib_release_signed.apk]:(AndroidManifest.xml) uses-permission: CONTROL_LOCATION_UPDATES:impact=1
[mib_release_signed.apk]:(AndroidManifest.xml) native-code: armeabi:impact=5
[mib_release_signed.apk]:Summary: [5]=1; [4]=0; [3]=0; [2]=0; [1]=2;
Summary: [5]=1; [4]=0; [3]=0; [2]=0; [1]=2 ;
Impact Legend: [5]=Severe; [4]=High /context; [3]=Medium /context; [2]=Medium-low /context; [1]=Minor;

The verifier divides the problems into groups of importance, there are only 5. If there are any complaints that belong to the group with priority 2 or higher, the application is considered incompatible and needs to be improved. In our case, “incompatible with life” turned out to be Google Maps and some native libraries, in particular, Bump. It was decided to remove these libraries from the BlackBerry version of the application. After that, run the utility again.
D:\projects\tcs\mb_client_android\out\artifacts>java -Xmx512M -cp "C:\soft\blackberry\CommandLineTools_1.5\blackberry.tools.SDK\bin\\..\lib\BARPackager.jar;C:\soft\blackberry\Comma
ndLineTools_1.5\blackberry.tools.SDK\bin\\..\lib\Apk2Bar.jar" net.rim.tools.apk2bar.Apk2BarVerifier mib_release_signed.apk
Apk2Bar /Verifier version 1.5.0
Research In Motion Ltd ? 2012 All rights reserved.
[mib_release_signed.apk]:(res/drawable-hdpi/logo_launcher.png) found an alternate icon with better size:impact=1
[mib_release_signed.apk]:(AndroidManifest.xml) uses-permission: CONTROL_LOCATION_UPDATES:impact=1
[mib_release_signed.apk]:Summary: [5]=0; [4]=0; [3]=0; [2]=0; [1]=2;
Summary: [5]=0; [4]=0; [3]=0; [2]=0; [1]=2 ;
Impact Legend: [5]=Severe; [4]=High /context; [3]=Medium /context; [2]=Medium-low /context; [1]=Minor;

This time, there are only two minor problems that can be ignored.

Design refinement


After the above steps, it was necessary to make changes to the design of the application: remove items from the menu, sections from “Payments”, adapt banners to fit the screen. The main changes affected the main page. Unfortunately, the graphics of the ported application behave not as predictably as described in the guidelines . The dimensions of the elements sometimes had to be chosen literally by touch. Part of the sections carried in the context menu. But, in general, with the new main screen and with the rest of the screens in the old design, the application looks no worse than the version for Android.



Signing and Testing


In order to sign the application, we need certificates. We go to the site and leave an application for their receipt. Usually the whole procedure takes about two hours, so you have to wait a bit. If everything is done correctly, then two files of the type client-RDK-123456.csj and client-PBDT-123456.csj will come to the mail. RDK file is used to sign the application, PBDT is used to create a debug token.

The next step is to install and register keys in the system:
blackberry-signer -csksetup -cskpass <create_a_password>

blackberry-signer -register -csjpin -storepass <RDK_CSJFile> <PBDT_CSJFile>

, , . debug-, , . .

blackberry-keytool -genkeypair -keystore <output_file.p12> -storepass <create_a_password> -dname "cn=<company_name>" -alias author


. -alias author , author , !

debug-token :
blackberry-debugtokenrequest -cskpass <csk_password> -keystore <developer_certificate> -storepass <keystore_password> -deviceId 0x<PIN_tablet> <debug_token_bar_file>

-deviceId , BlackBerry Device Manager .

(Settings -> Security -> Development Mode -> Use Development Mode “On”) :

blackberry-deploy -installDebugToken <debug_token> -device <IP_address> -password <device_password>

debug-token', -d *.p12 . , -d :

apk2bar <Android_app_or_folder> [-d [<debug_token>]]

, . :

blackberry-deploy -installApp -password <device_password> -device <IP_address> -package <your_app.bar>

, . , apk2barVerifier . , (, QR- bar- ..), BlackBerry . apk.

App World . bar- ( apk2bar -d)

blackberry-signer -storepass <store_pass> <your_app.bar>

, App World. ! . Windows 7 3 %HOMEPATH%\AppData\Local\Research In Motion


:
.
:
Android- ( , ); (, , , Android-, ); BlackBerry UI , , user experience ( BlackBerry).

blackberry-signer -register -csjpin -storepass <RDK_CSJFile> <PBDT_CSJFile>

, , . debug-, , . .

blackberry-keytool -genkeypair -keystore <output_file.p12> -storepass <create_a_password> -dname "cn=<company_name>" -alias author


. -alias author , author , !

debug-token :
blackberry-debugtokenrequest -cskpass <csk_password> -keystore <developer_certificate> -storepass <keystore_password> -deviceId 0x<PIN_tablet> <debug_token_bar_file>

-deviceId , BlackBerry Device Manager .

(Settings -> Security -> Development Mode -> Use Development Mode “On”) :

blackberry-deploy -installDebugToken <debug_token> -device <IP_address> -password <device_password>

debug-token', -d *.p12 . , -d :

apk2bar <Android_app_or_folder> [-d [<debug_token>]]

, . :

blackberry-deploy -installApp -password <device_password> -device <IP_address> -package <your_app.bar>

, . , apk2barVerifier . , (, QR- bar- ..), BlackBerry . apk.

App World . bar- ( apk2bar -d)

blackberry-signer -storepass <store_pass> <your_app.bar>

, App World. ! . Windows 7 3 %HOMEPATH%\AppData\Local\Research In Motion


:
.
:
Android- ( , ); (, , , Android-, ); BlackBerry UI , , user experience ( BlackBerry).

blackberry-signer -register -csjpin -storepass <RDK_CSJFile> <PBDT_CSJFile>

, , . debug-, , . .

blackberry-keytool -genkeypair -keystore <output_file.p12> -storepass <create_a_password> -dname "cn=<company_name>" -alias author


. -alias author , author , !

debug-token :
blackberry-debugtokenrequest -cskpass <csk_password> -keystore <developer_certificate> -storepass <keystore_password> -deviceId 0x<PIN_tablet> <debug_token_bar_file>

-deviceId , BlackBerry Device Manager .

(Settings -> Security -> Development Mode -> Use Development Mode “On”) :

blackberry-deploy -installDebugToken <debug_token> -device <IP_address> -password <device_password>

debug-token', -d *.p12 . , -d :

apk2bar <Android_app_or_folder> [-d [<debug_token>]]

, . :

blackberry-deploy -installApp -password <device_password> -device <IP_address> -package <your_app.bar>

, . , apk2barVerifier . , (, QR- bar- ..), BlackBerry . apk.

App World . bar- ( apk2bar -d)

blackberry-signer -storepass <store_pass> <your_app.bar>

, App World. ! . Windows 7 3 %HOMEPATH%\AppData\Local\Research In Motion


:
.
:
Android- ( , ); (, , , Android-, ); BlackBerry UI , , user experience ( BlackBerry).
blackberry-signer -register -csjpin -storepass <RDK_CSJFile> <PBDT_CSJFile>

, , . debug-, , . .

blackberry-keytool -genkeypair -keystore <output_file.p12> -storepass <create_a_password> -dname "cn=<company_name>" -alias author


. -alias author , author , !

debug-token :
blackberry-debugtokenrequest -cskpass <csk_password> -keystore <developer_certificate> -storepass <keystore_password> -deviceId 0x<PIN_tablet> <debug_token_bar_file>

-deviceId , BlackBerry Device Manager .

(Settings -> Security -> Development Mode -> Use Development Mode “On”) :

blackberry-deploy -installDebugToken <debug_token> -device <IP_address> -password <device_password>

debug-token', -d *.p12 . , -d :

apk2bar <Android_app_or_folder> [-d [<debug_token>]]

, . :

blackberry-deploy -installApp -password <device_password> -device <IP_address> -package <your_app.bar>

, . , apk2barVerifier . , (, QR- bar- ..), BlackBerry . apk.

App World . bar- ( apk2bar -d)

blackberry-signer -storepass <store_pass> <your_app.bar>

, App World. ! . Windows 7 3 %HOMEPATH%\AppData\Local\Research In Motion


:
.
:
Android- ( , ); (, , , Android-, ); BlackBerry UI , , user experience ( BlackBerry).

Source: https://habr.com/ru/post/168771/


All Articles