"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
Getting Started with Developing BlackBerry Android Apps
1. Getting Started with Developing for
BlackBerry Runtime for Android Apps
Kamel Lajili– RIM, Senior Application Development Consultant
DroidCon Berlin
March 14th 2012
2. Overview
What we will cover in this session
Why repackage for BlackBerry
BlackBerry Runtime for Android Apps - what it is and
what it is not
PlayBook development basics
Converting existing applications
Q&A
2
4. Why repackage?
BlackBerry App World
Available in 164 markets and growing
Averaging 174 Million downloads per month and
growing fast, more than 6 Millions per day!
BlackBerry App World vendor base grows by an average
of 190% per year
In EMEA there are Over 3K vendors from 59 countries
4
5. Why repackage?
BlackBerry App World
“BlackBerry Apps generate 40% more revenue as
Android apps“ (Vision Mobile)
Source: Application Distribution Survey, Evans Data, Sept 2011, Vision Mobile 5
6. Why repackage?
BlackBerry App World
“BlackBerry App World delivered the most
revenues over the past year, and the most monthly
traffic”
“13% of BlackBerry developers make over $100,000
from the App World apps, which is considerably more
than Android or Apple developers…”
“19% of BlackBerry App World participants say they
had 1,000 or more downloads over the 30 days”
6
7. Why repackage?
Opportunity to increase revenue with minimum (couple of
days) effort
in 65% of the cases just repackage the existing APK – no source
code or recompilation required
familiar development environment is provided for the cases when
modifications to the applications are required – Eclipse plugin on
top of Google's ADT plugin
Opportunity for experimenting with different business
model and a new customer base
7
9. What it is?
App1 App2 App3 App4 App5 App6 App7 App8
• It’s an application running on Playbook
Application Framework
Activity Mgr Window Mgr View System Notification
• Enables Android applications to be
Mgr installed and run on the BlackBerry
Package Mgr Resource Mgr Location Mgr
PlayBook Tablet
Libraries Java Runtime
• Android API level 10 – Android v2.3.3
WebKit OpenGL ES
Core Libraries
aka “Gingerbread” Application Framework
SSL SQLite running on top of the PlayBook OS and
Surface Mgr SGL Libraries.
Dalvik Virtual Machine
FreeType Media Fwk
libbionic
QNX Kernel @twitterhandle – 9
10. What it is …
Under the hood
A number of cooperating user mode processes that run
inside a sandbox
User mode ensures isolation from the OS kernel
Nothing runs as root
Applications requiring special access must have appropriate OS
capabilities
Sandbox ensures isolation from other native applications
Data sharing with other native applications is possible in restricted
fashion, e.g. photo, music, video, etc.
More secure and robust than other Android devices
10
11. What it is …
PlayBook integration
Blends in with the rest of the PlayBook applications
Application Launching/Minimizing/Thumbnail
Installation
Android applications are packaged as a BlackBerry Archive (BAR)
Deploy through BlackBerry® App World™ like other BlackBerry PlayBook tablet
apps
Android Media Framework
Graphics
Hardware accelerated OpenGL ES and screen composition.
Notifications
Sensors
Accelerometer, gyroscope, compass, etc.
@twitterhandle – 11
12. What it is …
PlayBook integration
Networking
Virtual keyboard
Multi-touch – 4-finger multi-touch
Standard public intents for launching native applications
Email, Camera, Photo Gallery, Video Recorder, Browser, Settings, etc.
Standard public intents for launching native 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
@twitterhandle – 12
13. What it is …
PlayBook integration
Security
BlackBerry Runtime for Android Apps runs in a secure PlayBook
OS sandbox that keeps android insulated from the rest of the
system. It’s treated as a secure PlayBook application and is
subject to the restrictions other native apps are subject to.
Existing Android permission system is retained by BlackBerry
Runtime.
Access to system resources are further protected by PlayBook OS
via Capabilities that need to be specified in BAR manifest.
@twitterhandle – 13
14. What it is not …
Things to be aware of
Review your UI
1024x600 screen resolution
32 bit color depth
xDPI, yDPI: 169.99, 169.33
Landscape orientation is the default
86x86 application icon
Notifications look different
No add-on Google libraries – Maps, C2DM, In-app billing
No Android Market
Limited Bluetooth support
14
15. What it is not …
Things to be aware of
Limited Camera integration – invoke but don’t embed
SIP/VOIP
Process sharing
Multiple entry points
Android Home screen/Widgets
Android NDK
Search key
HTTP progressive streaming
15
16. Online resources
Android
http://developer.blackberry.com/android
Documentation:
http://developer.blackberry.com/android/documentation
Where to get signing keys:
https://www.blackberry.com/SignedKeys/
@twitterhandle – 16
17. PlayBook development basics
BAR files
BAR files are the native PlayBook application packaging
What APK files are for Andorid BAR files are for BlackBerry
BAR files contain executables, images, media, etc.
blackberry-deploy: put a packaged app onto the device
The device has to be in development mode
17
20. PlayBook development basics
Signing
BARs are either signed or unsigned
Unsigned BAR requires Debug Token (except Simulator)
You will need signing keys to develop on Device:
http://developer.blackberry.com/native/signingkey
~1 hour turnaround
You will get
RDK key to sign for distribution
PBDT key to create debug token
20
21. PlayBook development basics
Debug tokens
Debug tokens allow you to load unsigned applications
from a specific author on a specific device
To request a debug token from the command line:
blackberry-debugtokenrequest -cskpass **** -keystore sigtool.p12 -storepass @@@@ -deviceId 0x500C8F54 0x500C8F54
debug.bar
To deploy a debug token on a device
blackberry-deploy -installDebugToken 0x500C8F54debug.bar -device 169.254.0.1 -password &&&&
Can also be requested and deployed from within the
Eclipse
21
23. PlayBook development basics
Submitting to BlackBerry AppWorld
Create an account for BlackBerry App World
https://appworld.blackberry.com/isvportal/
Application name, description and icon or logo
Category in which your app should be placed
License type (free, paid or try and buy)
Wireless service providers your app will be available to
Countries where your app should be distributed
Releases and file bundles
Screenshots
Submit signed BAR file
23
25. Converting existing applications
Compatibility categories
APK verifier for checking Android compatibility
Five categories on how well an application may run on PlayBook
Impact level 1 (minor non-compliance): Application will run just fine.
Impact level 2: Application may run but some functionality will not work
Unsupported features: Telephony, Camera, SIP, VOIP, etc.
Impact level 3: Application may run but some functionality will not work
Unsupported Google services: e.g. Google Maps.
Impact level 4: Application will most likely not functional
5-way navigation, h/w keyboard, C2DM
Impact level 5 (most severe): Application will not run.
Native libraries, dependency on 3rd party libraries
Eclipse plugin reports compatibility levels as errors
and/or warnings 25
30. Converting existing applications
Using the Eclipse plugin
ADT Plug-in for Eclipse + BlackBerry Plug-in for ADT
PlayBook is just another device target for your existing Android
project
Debugging applications on PlayBook just like on other Android
devices
adb, ddms, jdwp, logcat, etc.
30
31. Converting existing applications
Using the Eclipse plugin
1. Install “Eclipse IDE for Java Developers” 3.7 (Indigo)
http://www.eclipse.org/downloads/packages/eclipse-classic-37/indigor
2. Install Android SDK
http://developer.android.com/sdk/index.html
Also use the Android SDK manager to download the Android 2.3.3
platform and related tool and create an Android Virtual Device (AVD)
3. Install ADT Plug-in for Eclipse
http://developer.android.com/sdk/eclipse-adt.html
4. Install BlackBerry Plug-in for ADT
https://bdsc.webapps.blackberry.com/android/downloads/eclipseplugin/
31
33. Detecting a PlayBook
java.lang.System.getProperty("os.name")
Returns “qnx”
android.telephony.TelephonyManager.getDeviceId()
Returns unique device serial number – e.g. 0000000000429494272343
Same number can be found under Options -> About screen
Browser’s user agent
“Mozilla/5.0 (PlayBook; U; Android 2.3.3; en-us; PlayBook
Build/<build_no>) AppleWebKit/533.1 (KHTML, like Gecko)
Version/4.0 Mobile Safari/533.1”
33
34. Recap
BlackBerry Runtime for Android apps enables Android
applications to run on PlayBook in a secure and robust
environment with optimized performance
BlackBerry Runtime for Android apps enables developers
to monetize Android applications on PlayBook
Minimal cost in converting your Android applications
Majority applications (~65%) convert without any source changes
34