Date post: | 27-Jan-2015 |
Category: |
Technology |
Upload: | droidcon-berlin |
View: | 107 times |
Download: | 5 times |
Getting Started with Developing for BlackBerry Runtime for Android Apps
Kamel Lajili– RIM, Senior Application Development Consultant
DroidCon Berlin
March 14th 2012
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
Repackage Your Android Apps
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
Why repackage? BlackBerry App World
Source: Application Distribution Survey, Evans Data, Sept 2011, Vision Mobile 5
“BlackBerry Apps generate 40% more revenue as Android apps“ (Vision Mobile)
Why repackage? BlackBerry App World
6
“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”
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
Need a PlayBook to port your
Android Apps?
What it is?
• It’s an application running on Playbook
• Enables Android applications to be
installed and run on the BlackBerry
PlayBook Tablet
• Android API level 10 – Android v2.3.3
aka “Gingerbread” Application Framework
running on top of the PlayBook OS and
Libraries.
@twitterhandle – 9 QNX Kernel
Libraries
Surface Mgr
WebKit
FreeType
SGL
SSL SQLite
OpenGL ES
Media Fwk
libbionic
Java Runtime
Dalvik Virtual Machine
Core Libraries
Application Framework
Activity Mgr
Package Mgr Resource Mgr
Window Mgr View System
Location Mgr
Notification
Mgr
App1 App2 App3 App4 App5 App6 App7 App8
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
What it is … Under the hood
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
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
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
What it is … PlayBook integration
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
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
What it is not … Things to be aware of
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
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
PlayBook development basics BAR files
@twitterhandle – 18
PlayBook development basics Development mode
@twitterhandle – 19
PlayBook development basics Development mode
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
PlayBook development basics Signing
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:
To deploy a debug token on a device
Can also be requested and deployed from within the Eclipse
21
PlayBook development basics Debug tokens
blackberry-debugtokenrequest -cskpass **** -keystore sigtool.p12 -storepass @@@@ -deviceId 0x500C8F54 0x500C8F54
debug.bar
blackberry-deploy -installDebugToken 0x500C8F54debug.bar -device 169.254.0.1 -password &&&&
22
PlayBook development basics Debug tokens
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
PlayBook development basics Submitting to BlackBerry AppWorld
Online tool
Command line
Eclipse plugin
24
Converting existing applications
Choosing your method
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
Converting existing applications
Compatibility categories
https://bdsc.webapps.blackberry.com/android/bpaa/
26
Converting existing applications
Using the online tool
Demo: Converting using the online tool
1. apk2barVerifier
2. apk2bar
3. blackberry-deploy
28
Converting existing applications
Using the command line tools
Demo: Converting using the command line tools
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
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
Converting existing applications
Using the Eclipse plugin
Demo: Converting using Eclipse plugin
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
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
Questions?
Q&A
35
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 – 36
THANK YOU
Kamel Lajili– RIM, Senior Application Development Consultant, @klajili
DroidCon Berlin
March 14th 2012