ICEmobile on the BlackBerry Z10
At last, we have obtained a BlackBerry Z10 from the good folks at Telus (thanks to Rob). Without question, this is the best BlackBerry yet. It is a well constructed, modern smartphone with all of the required features for building interesting applications (front and rear cameras, accelerometer, gyroscope, and high resolution display).
It will be fun to try out the various BlackBerry Apps, but for ICEmobile the most important App is, of course, the browser. Now that Philip has added in ICEmobile device detection for the BlackBerry 10 (the example instructions below provide a tutorial for MacOS X):
User-Agent: Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+
things are working well:
(This was a new device, so we did require another important fix: the BlackBerry 10 supports FormData for Ajax file uploads, so this was enabled, but is still disabled in ICEmobile BlackBerry 6 detection.)
In other words, the BlackBerry 10 browser looks very solid and will be a great browser for ICEmobile.
What about native features that take advantage of the device beyond the browser? The shortest path for ICEmobile is actually to start from the Android binary (we are still investigating the C++ runtime environment). Greg and I took the following steps to get the ICEmobile Android .apk installed onto the BlackBerry 10 device:
Download the command line tools.
Extract the tools:
Prepare your local system for code signing:
./blackberry.tools.SDK/bin/blackberry-signer -csksetup -cskpass mypassword
Obtain your keys. This is now free and the keys arrive within 2 hours via email.
Prepare your local keystore .p12 file:
./blackberry.tools.SDK/bin/blackberry-signer -register -csjpin mypassword -storepass mypassword client-RDK-5551212.csj client-PBDT-5551212.csj
./blackberry.tools.SDK/bin/blackberry-keytool -genkeypair -keystore blackberry-dev.p12 -storepass mypassword -dname "cn=mycompany" -alias author
For the next step you will need your device “PIN”. From the home screen, go into “Settings” then “About” then “Hardware” and look for the hex PIN entry.
./blackberry.tools.SDK/bin/blackberry-debugtokenrequest -cskpass mypassword -keystore blackberry-dev.p12 -storepass mypassword -devicepin cafebeef z10-debug-token.bar
To install anything on the device, you need to activate the developer tools: from the home screen go into “Settings” then “Security and Privacy” then “Development Mode” and set “Development Mode” to “On”.
Now you can deploy your debug key to the device:
./blackberry.tools.SDK/bin/blackberry-deploy -installDebugToken z10-debug-token.bar -device 192.168.0.101 -password mypassword
Repackage your Android .apk as a BlackBerry .bar:
./blackberry.tools.SDK/bin/apk2bar ICEmobileContainer.apk ./android-sdk-macosx -d z10-debug-token.bar
And finally deploy the .bar to the device:
./blackberry.tools.SDK/bin/blackberry-deploy -installApp -device 192.168.0.101 -password mypassword ICEmobileContainer.bar
The container has a slightly different User-Agent:
User-Agent: Mozilla/5.0 (PlayBook; U; Android 2.3.3; en-us; PlayBook Build/10.0.0.279) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Incredibly, the Android runtime on the BlackBerry 10 is almost indistinguishable from a native Android device. The vast majority of ICEmobile features worked immediately, including Camera, Camcorder, Audio Recording (which uses a fallback Activity that we created for the Nexus 7), and even QR Code scanning via zxing. Cloud Push needs some additional work. Augmented Reality displays the video overlay and does not crash, but doesn’t display the “augmentations” either, so some work is still required there. All in all, not bad for a half day of effort.
So if you’re wondering about the BlackBerry 10, you should definitely check it out. Combined with ICEmobile, this will be a very strong platform for Enterprise applications, and it has all the features to make it an excellent personal phone.