Developing Android Apps for
BlackBerry 10
JAM854
Mike Zhou- Developer Evangelist, APAC Nov 30, 2012
Overview
What is the BlackBerry Runtime for Android Apps? Releases and Features
New Features Demo Development Basics
Converting Existing Android Apps
Signing and Publishing to BlackBerry World
Q&A
What is the Android Runtime?
5 Minute Overview
What is the Android Runtime?
Overview
• Android open source version 2.3.3 aka “Gingerbread” application framework running on top of BlackBerry PlayBook and BlackBerry 10 OS
• Enables ported Android apps to be installed and operate on BlackBerry PlayBook OS 2.0+ and BlackBerry 10
• Deep integration with BlackBerry native framework with the objective to make Android apps indistinguishable from native applications
What is the Android Runtime?
Compatibility & Limitations
• About 65-70% of all Android apps are compatible today • Not all Android APIs are supported
► Hardware and OS limitations
• Android Apps are limited to the personal perimeter • Full compatibility list see:
► http://developer.blackberry.com/android/apisupport
Why should you repackage?
65% of the existing Android applications require no change
• Monetize on BlackBerry platform
BlackBerry apps are downloaded 43% more often than the same
app on Apple App Store and 48% than on Android Market
Developers selling apps through BlackBerry World make
significant more money than other app stores.
13% BlackBerry developers have made over US $100,000
Releases and Features
BlackBerry PlayBook and BlackBerry 10
Native Integration
Graphics
Hardware accelerated OpenGL ES and screen composition
Media Framework Multi-touch
Sensors
Accelerometer, gyroscope, compass, etc.
Networking
Virtual Keyboard UX / Home Screen
Application Launching/Minimizing/Thumbnail, Notifications, etc
Native Integration (Cont’)
Implicit Intents with launching applications
Email, Camera, Photo Gallery, Video Recorder, Settings, etc.
Implicit Intents with launching file viewers
.pdf, .doc, .xls, .ppt, .png, .jpg, .gif, audio, video, etc.
Shared storage for public data
/sdcard/ -> /accounts/1000/shared/misc/android/
Accessible by other native applications and through USB
Installation
Android application is packaged as a BlackBerry Archive (BAR) Deploy through BlackBerry World like other BlackBerry 10 apps
Releases and Features
BlackBerry Runtime for Android Apps
Releases and Features
BlackBerry 10
Improved Usability
Integration with new virtual keyboard
Multi-Window support
Support for notifications
Intents invoke core BlackBerry 10 apps
Compose email, Contacts, Calendar, Browser
Improved Compatibility
Camera API
In-app Payments
Telephony APIs
Support for location based intents to display maps Use WebView + web services (Google, Bing, etc.) to
display map content within apps
More details on mapping support can be found on the API Support Page
http://developer.blackberry.com/android/apisupport
12
Releases and Features
@Override
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webView = (WebView) findViewById(R.id.mywebview); webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("http://maps.google.com/?ll=36.97,-122&lci=bike&z=13&t=p");
}
13
Releases and Features
Demo
New features: Multi-Window, Camera, Mail, Calendar
Development Basics
Convert, Sign and Submit!
Tools
Online Conversion Tool - Quickest way to get apps converted Eclipse Plug-in - For most Android developers
Command-line Tools - Advanced development options Simulators - BlackBerry PlayBook and BlackBerry 10
Basic concepts
Code Signing
Development Debug Tokens
16
Development Basics
Converting Existing Apps
Online Conversion Tool
17 ► Select the location of your APK file ► Select the location of your Android SDK folder
Converting Existing Apps
Online Conversion Tool
Converting Existing Apps
Online Conversion Tool
19
► Warnings range
from mild (level 1) to severe (level 5)
► Apps that receive
warnings less than level 2 are considered compatible
► Apps which receive
warnings of level 2 or higher are generally considered to be incompatible
• ADT Plug-in for Eclipse + BlackBerry Plug-in for ADT
20
Converting Existing Apps
Eclipse Plug-in for Android
► PlayBook and BlackBerry
10 are just another device target for your existing Android project
► Debugging applications on
BlackBerry just like on other Android devices
UX Consideration
Resize your application icon to 86x86/114x114
Requirement for icons in the PlayBook/BlackBerry 10 home
screen
Default (natural) orientation Screen size and density
1024x600/1280x768/720x720
Check for new update
Bad UX for prompting users for update or to launch Android
Market
Let BlackBerry World do the update check for you
About and Version
Repackage your APK to a BAR file in 4 easy steps… 1) Check your APK for compatibility
apk2barVerifier
2) Repackage your APK file as a BAR apk2bar
3) Sign your application batchbar-signer 4) Deploy your application
blackberry-deploy 22 C:\Program Files\Android\android-sdk\bin> apk2barVerifier HelloWorld.apk C:\Program Files\Android\android-sdk\bin> apk2bar HelloWorld.apk C:\Program Files\Android\android-sdk\bin> batchbar-signer HelloWorld.bar author.p12 p12password rdkpassword
C:\Program Files\Android\android-sdk\bin> blackberry-deploy –installApp –device 169.254.0.1 –package HelloWorld.bar –password devicepassword
Development Basics
A code signing key is required to test your app and to publish your app to BlackBerry World
They can also be used to generate a debug token for your BlackBerry PlayBook or BlackBerry 10 Dev Alpha Request code signing keys here
http://developer.blackberry.com/android/signingkey
23
Development Basics
Global marketplace
FREE to register as a vendor FREE to submit apps and
upgrades
70/30 revenue share
Credit card, PayPal, carrier billing
Free and paid apps catalog Integrated barcode scanning
Development Basics
Success Stories
• PineLake Communications on Porting Cubifice to BlackBerry 10
Ported existing OpenGL
Android application
Porting process took 1 hour
25x more downloads in
App World versus Google Play
For More Information…
BlackBerry Runtime for Android apps homepage
http://developer.blackberry.com/android/
BlackBerry Runtime for Android apps Roadmap
http://developer.blackberry.com/android/tools/roadmap/
Repackaging and Development Tools
http://developer.blackberry.com/android/tools/
Getting started tutorial
http://developer.blackberry.com/android/documentation/gettingstarted.html
… And a few Quick Notes
Download the Code Hunt App at the desk in the Social Media Lounge and join the NFC scavenger hunt!!
Have more questions? Visit Ask the Experts at noon today by the coding lounge in the Jam Space.
Don’t forget to fill out the Conference Survey at the Registration Desk to claim a free gift!
THANK YOU
JAM854
Mike Zhou- Developer Evangelist, APAC Nov 30, 2012