33
Reach A New Market In 3 Minutes (or less!) developer.blackberry.com/android Larry McDonough Principal Evangelist @LMCDUNNA

Android to BB in 3 minutes

Embed Size (px)

DESCRIPTION

Update on latest BB10 support for Android apps (big one: native library support!). Overview of process, tools and a live demo on stage moving the Nest app to BlackBerry Z10 in under 3 minutes.

Citation preview

Page 1: Android to BB in 3 minutes

Reach A New Market

In 3 Minutes (or less!) developer.blackberry.com/android

Larry McDonough Principal Evangelist

@LMCDUNNA

Page 2: Android to BB in 3 minutes

Android Onboarding & Virtual Office Hours

What is BlackBerry 10?

How does BlackBerry 10 run Android apps?

Repacking & testing your Android app on

BlackBerry 10

Submitting your Android app to BlackBerry

World

2 developer.blackberry.com/android

Page 3: Android to BB in 3 minutes

BlackBerry 10

New mobile computing platform and hardware Brand new hardware/software based on QNX

Best-in-class browser (491 HTML5 Test score)

Cutting-edge multimedia capabilities

More apps than any first-generation platform at launch

Full-touchscreen and keyboard-based smartphones

Bringing your Android app to BlackBerry 10 can take as little as

3 minutes

3 developer.blackberry.com/android

What is BlackBerry 10?

BlackBerry Z10

Page 4: Android to BB in 3 minutes

BlackBerry Runtime for Android Apps

Open-source Jelly Bean (Android

4.2.2) Application Framework running

on top of BlackBerry 10 OS and

Libraries

Enables repackaged Android apps to

be installed and run inside it

Deep integration with BB native

framework to make Android apps

indistinguishable from native apps

Repackaging your Android app can

take as little as 3 minutes

4 developer.blackberry.com/android

Dalvik

VM WebKit C++

Page 5: Android to BB in 3 minutes

BlackBerry Runtime for Android Apps

5

Increased Compatibility: Over 80% of converted Android

apps work without any changes to source code

Support for Android Native, Accessibility, Bluetooth,

MapView v1, Share Framework, Spellcheck, Wi-Fi Scanning

Broader Reach

Integrate with the BlackBerry ecosystem and get access

to the BlackBerry World distribution channel, more

customers, and additional revenue opportunities.

Page 6: Android to BB in 3 minutes

6

The Android Runtime In Action

► Songza

Page 7: Android to BB in 3 minutes

7

The Android Runtime In Action

► Flipboard

Page 8: Android to BB in 3 minutes

8

The Android Runtime In Action

► Deezer & WordPress

Page 9: Android to BB in 3 minutes
Page 10: Android to BB in 3 minutes

10.2 - August 2013 Android 4.2.2 (Jelly Bean/API 17)

Improved Stability

Support for the end-user to hide/show back bar

10

Android Roadmap

Page 11: Android to BB in 3 minutes

10.2.1 Gold– January 2014

11

Android Roadmap

Page 12: Android to BB in 3 minutes
Page 13: Android to BB in 3 minutes

Unsupported APIs

13

Around 80% of all Android apps are compatible today on BlackBerry 10.2.1 requiring no changes to source code

Not all Android APIs are supported

Hardware and OS dependencies

Limited to the personal perimeter

Full compatibility list is available at developer.blackberry.com/android/apisupport

Page 14: Android to BB in 3 minutes

Push Support

Both c2dm and GCM are supported:

Client

Register with BlackBerry Push Services

Create android.cfg file

Package the android.cfg file within BAR

Sign app

Server

Push JSON payload to both Google &

BlackBerry app servers

Pushes are queued until app is open

14 developer.blackberry.com/android/apisupport/creating_push-enabled_android_apps.html

<?xml version="1.0" encoding="utf-8"?>

<android>

<push>

<appid>some_appID</appid>

<ppgurl>http://cpXXX.pushapi.eval.blackberry.com</ppgurl>

<tokenprefix>bb-</tokenprefix>

</push>

</android>

Page 15: Android to BB in 3 minutes

In-App Billing Support

Test using BlackBerry World sandbox

Use the same ItemID values for your

digitalSKU items in vendor portal

One-time purchases, no subscriptions, no

refunds through API

Which OS? Which Device? java.lang.System.getProperty("os.name") returns ("qnx")

android.os.Build.DEVICE returns “Q10”, “Q5”, “Z10”, or “Z30”

15 developer.blackberry.com/android/apisupport/apisupport_inapp_payments_support.html

Page 16: Android to BB in 3 minutes
Page 17: Android to BB in 3 minutes

Android Native Code

Android NDK lets you write parts of your app in C/C++

Meant for self-contained, CPU-intensive operations, shared x-platform libraries, third-party libraries

When moving between Java and Native code, the Java Native Integration (JNI) bridge is crossed,

requiring Android system resources

Android only provides header support for the following: o libc (C library) headers

o libm (math library) headers

o JNI interface headers

o libz (Zlib compression) headers

o liblog (Android logging) header

o OpenGL ES 1.1/2.0

o libjnigraphics (Pixel buffer access) header

o A Minimal set of headers for C++ support

o OpenSL ES native audio libraries

o Android native application APIS

17 developer.blackberry.com/android/

Page 18: Android to BB in 3 minutes

Android Native Code

BlackBerry 10.2.1 OS o Both the ARMv5TE and ARMv7-A machine code instruction

sets are supported

Android Tooling 2.0 o New toolset to account for various IDEs via Device Profiler

o Simple GUI

o Tooling will no longer report *.WRN file errors related to

Native code, Bluetooth or Google Maps v1

o Native on-device debugging

Support o Same level support for libraries as Google publicly offers (9)

18 developer.blackberry.com/android/apisupport/unsupported_api_android_ndk.html

Page 19: Android to BB in 3 minutes
Page 20: Android to BB in 3 minutes

Verify Repackage Deploy

Repackaging Android Apps

developer.blackberry.com/android

Verify

- Run blackberry-apkpackager to generate a *.WRN file which will call out unsupported

APIs and repackage the APK to a BAR file

Repackage

- Run blackberry-signer to sign the BAR file

Deploy

- Run blackberry-deploy on an up-to-date OS, testing functions called out in the *.WRN file

Page 21: Android to BB in 3 minutes

Repackage your APK to a BAR file in 3 easy steps…

1) blackberry-apkpackager

- runs a compatibility check on your APK file

- packages your APK file as a BAR file

2) blackberry-signer

- sign your application

3) blackberry-deploy

- test your app

21

C:\Android\android-sdk\bin> blackberry-apkpackager HelloWorld.apk C:\Android\android-sdk\bin> blackberry-signer –storepass pass123 HelloWorld.bar C:\Android\android-sdk\bin> blackberry-deploy –installApp –device 169.254.0.1 –package HelloWorld.bar –password pass123

Repackaging APK Files

► Option 1: Command-line SDK

Page 22: Android to BB in 3 minutes

22

\bin>blackberry-apkpackager –gui

Append the –gui parameter to use a GUI

window for point-and-click repackaging

blackberry-apkpackager –gui

Provide the APK file location, target

location and select Package

Sign and deploy within the same step!

Repackaging APK Files

► Option 2: GUI-based SDK

Page 23: Android to BB in 3 minutes
Page 24: Android to BB in 3 minutes

24

\bin>blackberry-signer -gui

Signing Your Application

Sign your resultant BAR file, or configure your BlackBerry ID signing account

Repackaging APK Files

► Option 2: GUI-based SDK

Page 25: Android to BB in 3 minutes

25

\bin>blackberry-signer -gui

Setting Up Your BlackBerry ID Signing Account

From the BlackBerry Signer window, select Configure Signing

Provide what will be your CSK Password (signing password)

and Author Name

Select Request and log into/create your BlackBerry ID account

Select Create

Repackaging APK Files

► Option 2: GUI-based SDK

Page 26: Android to BB in 3 minutes

26

\bin>blackberry-deploy -gui

Deploying Your App

Deploy your resultant BAR file to a

BlackBerry 10 simulator or device

Provide the BAR file location, device IP

address and password10 simulator or device

Ensure that your physical device has

Development Mode enabled

Repackaging APK Files

► Option 2: GUI-based SDK

Page 27: Android to BB in 3 minutes
Page 28: Android to BB in 3 minutes

Icon: 114 x 114 pixels

Resolution: 1280 x 768 (15:9)

Screen size: 4.2” diagonal

Project structure: res/drawable-xhdpi

Current OS: BlackBerry 10.2.1

Testing: BlackBerry 10 Device Simulator

developer.blackberry.com/android/documentation/port_android_app_to_bb_device.html

BlackBerry 10 Devices

► BlackBerry Z10

Page 29: Android to BB in 3 minutes

Icon: 114 x 114 pixels

Resolution: 1280 x 720 (16:9)

Screen size: 5” diagonal Super AMOLED

Project structure: res/drawable-xhdpi

Current OS: BlackBerry 10.2.1

Testing: BlackBerry 10 Device Simulator

developer.blackberry.com/android/documentation/port_android_app_to_bb_device.html

BlackBerry 10 Devices

► BlackBerry Z30

Page 30: Android to BB in 3 minutes

Icon: 114 x 114 pixels

Resolution: 720x 720 (1:1)

Screen size: 3.1” diagonal

Project structure: res/drawable-square

Current OS: BlackBerry 10.2.1

Testing: BlackBerry 10 Device Simulator

developer.blackberry.com/android/documentation/port_android_app_to_bb_device.html

BlackBerry 10 Devices

► BlackBerry Q10

Page 31: Android to BB in 3 minutes

Icon: 114 x 114 pixels

Resolution: 720x 720 (1:1)

Screen size: 3.1” diagonal

Project structure: res/drawable-square

Current OS: BlackBerry 10.2.1

Testing: BlackBerry 10 Device Simulator

developer.blackberry.com/android/documentation/port_android_app_to_bb_device.html

BlackBerry 10 Devices

► BlackBerry Q5

Page 32: Android to BB in 3 minutes

Device OS autoloaders

https://developer.blackberry.com/blackberry10devalphas/update/

Simulator & SDK download

https://developer.blackberry.com/android/tools/

Pulling Android logs

http://devblog.blackberry.com/2013/11/pull-android-logs-from-your-blackberry/

Programmatically disabling the back bar

http://devblog.blackberry.com/2013/12/android-developers-eliminate-the-back-bar-in-

your-10-2-1-app/

developer.blackberry.com/android/

Additional Resources

Page 33: Android to BB in 3 minutes