Yipee! These are exciting times for some of us developers. Why not? RIM, the company behind the most popular Smartphone in the Nigerian market is weeks away from releasing its much talked about OS 10. As developers, we all have our personal reasons for the excitement. For the most part, it offers us even more avenue to get our apps into the hands of our target audience. On my part, the multi-faceted support it provides for developing or porting of apps namely WebWorks, java, Adobe AIR etc is such that some of us need not embark on a new learning curve to get on the platform.
For Adobe AIR developers or those looking to capitalize on their Flash or ActionScript 3.0 skills for the BB10 platform, this post should get you started.
Some weeks ago, I had issues deploying my AIR apps to the BB 10 device and posted on the forum. Thanks to Michael Weitzel plus a couple of online resources, I had it figured out. Thus, I’ll be sharing with you an aggregated guide on how to port your AIR built app for the BB 10.
Which leads us to my introductory topic …
Deploying Adobe AIR apps to the BB 10 ALPHA DEVICE: novice to ninja!
Traditionally, I use the Adobe Flash IDE for my development so we’ll use a simple helloworld project as test. Here’s all you need to get started.
– Download the AIR SDK from https://developer.blackberry.com/air/download/.
– Also, open up your command line. Yeah I know, that black screen that some of us never want to deal with. Well, I find it’s a handy companion in my case so relax.
STEP 1: Install the BlackBerry OS 10 SDK for AIR. Be sure to note the folder path where it is being stored during installation. This’ll come in handy during stage 2.
STEP 2: Set the path to the bin. This is to allow you call the tools for the packaging, signing etc from the command line without having to type out the full path where it is stored.
For Windows user,
– Right-click on “My Computer”, Select Properties.
– From the window that opens, select “Advanced System Settings” at the top left.
– Next, select “Advanced” from the tabbed menu that opens.
– From there, select “Environment Variables” then “Path”.
– Next, click the “Edit” button.
– Now, go into the folder where you saved your package during installation. Locate the ‘ bin’ folder and copy off the path at the top. In my case, it was “C:\Users\GETTO\Documents\BB_10_Tools\blackberry-tablet-sdk-3.0.0\bin”. Be sure to change the path to reflect yours. Before pasting, make sure the last line on the existing line has a semi-colon (;) else, append it to it then paste. Finish by adding a semi-colon (;) then select OK.
To test for its success, open your Command line. You may have to exit and re-open if it was open during the previous process.
Type blackberry-airpackager and select the ‘Enter’ key on your keyboard. You should see a bunch of lines spill out.
Bingo! Stage 1 scaled. Grab a cup of water before we proceed.
STEP 3a: Registrations
For BlackBerry developers, testing your app on the device requires two processes. One, you can either request a signing key from RIM or two, obtain a debug token. In my case, I went with the former since I’d still have to do so for publication to the BlackBerry App world. Know that “an internet” connection is required for this process.
The following steps are critical to the signing process so do please proceed carefully. The beauty is that you only have to complete it once. Let’s get on with it
– First, request for a signing key from RIM by following the link https://www.blackberry.com/SignedKeys/codesigning.html
While filling the form, please note the PIN you enter as it’ll be used afterwards. This PIN is not your BB PIN. Rather, a sort of password that you should provide.
– Once successful, you’ll get an email asking you to wait for some hours. Notwithstanding, it arrives in your email much lesser than say 2 hours. In the meantime, ensure you check your SPAM folder too.
– The file comes as an attachment with a .CSJ format. It’s named something like client-RDK-1234****.csj
– Download it and note the path where it is stored
STEP 3b: Creating the CSK file
– Next, we create what is called a CSK file by typing the following into your command line making sure to use your desired password in the text marked in red. I find that it helps to use the same password (PIN) used while requesting for the signing keys in Step 3a above. Since there is nothing stopping you from doing so, I recommend you use same password.
Blackberry-signer –csksetup –cskpass yourcskpassword
You should get a prompt saying CSK file created
STEP 3c: Register your .csj file with the RIM server
– Now, type the following into your command line
Blackberry-signer –register –csjpin ThePINyouEnteredWhileRequestingCSJinStep3a –cskpass ThePasswordYouPutWhileCreatingCSKinStep3b fullpathofthedownloadedCSJfile.csj
Note that you have “Three” specific information to provide above
– fullpathofthedownloadedCSJfile.csj i.e. the full path of the file with the .csj appended e.g. c:/users…/client-RDK-1234****.csj
Select “Enter” on the keyboard. You should get a notification saying “Successfully registered with server” on the command line. An email is also sent to you from email@example.com with the subject “Successful Registration Request for Client 1234****”
STEP 3d: Create the .P12 Certificate that will be used for your app signing
– Enter the following in your command line
Blackberry-keytool –genkeypair –keystore DesiredCertificateName.p12 –storepass Password –dname “cn=YourCompanyName” –alias author
Note that you have “Three” specific information to provide
– DesiredCertificateName.p12 i.e. any name you desire plus the .p12 appended
– Password: Though it could be a new one, I highly recommend you use same password from Steps 3a and 3b above to avoid confusion
– YourCompanyName i.e. the name you desire. Please note that this name CANNOT contain commas. Spaces may be used. Lastly, ensure you use the ‘cn’ and the quotes (“”) as in the example
Once done, the certificate (an envelope-looking symbol with a key) is created in the path where you are calling the commands. Go into the path and copy it into your desired folder.
STEP 4: Packaging the bar file. The BB 10 apps use the .bar file format hence, you have to package the helloworld.swf (a simple helloworld file published as swf from the Flash IDE) file along with associated files or assets (audio, folders, icon etc). In our case, we don’t use any associated assets.
First, here are the required files for the process:
– Application descriptor XML file. This file usually contains the name of the app then an hyphen and app. In my case, my main file is titled helloworld.swf thus, my application descriptor file is entitled helloworld-app.xml.
– An icon file. The icon that’ll be specific to your app. It should be 114 X 114 pixels and saved as .png format.
– A splash file in jpg format. I usually prefer it to be sized as the device target. For the Dev Alpha device spec of 1280 X 768 thus I use same for my splash size. Note that this splash screen is an optional feature.
– Lastly, a bar-descriptor XML file that contains information about the icon and splash screen mentioned above. For those of us familiar with Playbook development, it is the same as the blackberry-tablet.xml file.
As a caveat, I like to have all my files in one directory hence, copy all your files into a folder. In this case, I simply created a folder in the C:\ directory, named it helloworld and dumped all my files into it. Ensure you also have the p12 certificate created in Step 3d above copied into the folder too as you’ll be referencing it later.
Step 4a: Create the bar-descriptor.xml file as follows. I recommend using a notepad. Copy the following changing say the publisher value to reflect yours and save as bar-descriptor.xml in your folder where you have other files.
</ splashscreen >
Step 4b: Create the app-descriptor xml file. Remember it is named as follows: [appname]-app.xml. In this case, we name it helloworld-app.xml
For Adobe Flash 5.5 users, it is auto-generated for you when you publish to Android. For this exercise, you can simply modify the following below and save as your app’s.
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no” ?>
Step 4c: Create the BAR file
– On the command line, type the path of your folder using the line cd followed by the path. In my case it is cd C:\helloworld
– Type the following into the command line and select the Enter key on your keyboard
blackberry-airpackager -package helloworld.bar helloworld-app.xml bar-descriptor.xml helloworld.swf helloworld-icon.png helloworld-splash.png
Remember to leave spaces between helloworld.bar, helloworld-app.xml, helloworld.swf, helloworld-icon.png and helloworld-splash.png
Also, the texts in red indicate the names of the desired bar file, the xml files created in Steps 4a and 4b above, the desired icon (114*114 pixels) and splash
If successful, you should see the file in the directory C:\helloworld.
STEP 5: Signing the app. This allows for you to distribute the app to the BlackBerry app world. It’s a two step process as explained below
With steps 3 completed, you should now have your .P12 certificate (a file that looks like an envelope with a key underneath).
Ensure it is copied into your directory in this case, the c:\helloworld folder
Also, remember that internet connection is required for this signing as it sends the request to RIM
STEP 5a: Signing with RIM.
Type out the following lines in your command line
blackberry-signer -verbose -cskpass CSKPassword -keystore CertificateName.p12 –storepass StorePassword helloworld.bar RDK
What follows is couple of lines that should end with a bar signed message if successful.
STEP 5b: Signing the package with your (author) side
Enter the following in your command line
blackberry-signer -keystore CertificateName.p12 -storepass StorePassword RimSignedBarFile.bar author
STEP 6: Deploying to the Device
– First, go to the settings menu of your device, select “Security”. Then, “Developer Mode” and turn it on. You’ll be asked to enter a password or create one if none is existent.
Finally, enter the following in your command line
blackberry-deploy -installApp -device DEVICE_IP -password DEVICE_PASSWORD C:\helloworld.bar
Note the following
- DEVICE_IP i.e. the IP of the device which can be found in the settings menu
- DEVICE_PASSWORD i.e. the password for the device
STEP 7: Submit your app to the app world by following the link https://developer.blackberry.com/appworld
Finally made it through to the end. Do please let me know if you have any issues. Until my next piece, happy development.