Native Application (C/C++)
development on BlackBerry 10
Aaron Ardiri
Principal Developer Evangelist
AARDIRI@rim.com
twitte...
BlackBerry 10
SDKs

C++/Qt

Cascades

C/C++

HTML5 BlackBerry®

Native SDK

WebWorks™

ActionScript

Java

Adobe® AIR®

An...
Native SDK
OSS & Developer Experience
Native SDK
Hello World
#include <stdio.h>
#include <stdlib.h>
int
main(intargc, char **argv)
{
fprintf(stdout, “Hello Worl...
Native SDK
BlackBerry Platform Services
the BlackBerry Platform Services (BPS) library provides an
application with a sing...
Native SDK
BlackBerry Platform Services
bps_event_t *event_bps;
event_bps = NULL;
bps_get_event(&event_bps, timeout); // -...
Native SDK
BlackBerry Platform Services
handling {service} events
{service}_request_events({param}); // request events

th...
NATIVE SDK:
“HARDCORE” DEVELOPMENT
VI, BASH &SSH DEBUGGING
Native SDK
Open Industry Standards
Native SDK
Open Source Support
CASCADES SDK
Cascades SDK
OSS & Developer Experience
Mature C++ application framework
Good APIs
Signals and Slots
Many help classes

QML
QtGui Cascades
Qt
• Cross-platform application framework
• Design GUI, Command line, Daemon Applications
• More than a software developme...
Powerful toolkit with many components
• QtNetwork Module
• QtMedia Module
• QtCore
• C++ Extensions
QtQuick
• QtModeling L...
Replacement for QtQuick
• Cascades UI rendering is NOT on the main thread!
Features
• Provides BlackBerry Look and Feel
• ...
CascadesSDK
Hello World
import bb.cascades 1.0
Page {
content: Label {
text: "Hello World"
}
}
Cascades SDK
Hello World
Page* root = new Page;
Label* label = Label::create()
.text("Hello World");
root->setContent(labe...
60 FPS!
UI in separate thread

App logic
28

Cascades

Photos by rumpleteaser and whologwy Flickr
Scene Graph
Root
Container

Hello World

RotationZ
Scale
Opacity

Container
Text: “Hello World”
Scene Graph
Designing UI with QML
• QML User Interfaces built on Object-Tree Model
• Need a root node
Typical root nodes
•...
In QML

Container {
opacity: 0.5
scaleX: 1.5; scaleY: 1.5
rotationZ: 45
ImageView { … }
Label { … }
}
C++

Container *bubble= new Container();
bubble->setOpacity(0.5f);
bubble->setScale(1.5f);
bubble->setRotationZ(45);
bubbl...
Events
Qt uses signals&slots paradigm
Cascades events are mapped to Qt signals
Handling Touch Events in QML
Container
{
onTouch:
{
if (event.isDown()) {
scaleX = 2; scaleY= 2; rotationZ = 45;
}
else if...
Handling Touch Events in C++

QObject::connect(bubble,SIGNAL
(touch(bb::cascades::TouchEvent*))
this,SLOT
(touched(bb::cas...
C++

QML

You can choose!
No difference between UI created in QML or C++

They can be combined
Typically, UI in QML and bu...
Animations

Any Cascades UI element can be animated

Animations are “running” on the engine thread
Remember the client ser...
Core Controls
Custom controls
Custom Controls
SpeedGauge
Container
DockLayout

RotationZ (-0)
TranslationY
(30)

RotationZ (-40)
TranslationY(3
0)
Standard List Items
Custom list items
Data Binding
SQL

XML

JSON

Anyth
ing
StackLayout&DockLayout
Pages, Panes and Navigation
CASCADES SDK:
“PLEASING” DEVELOPMENT
IDE, GUI, REAL-TIME UPDATES
For More Information…

developer.blackberry.com/cascades
Thanks!
Aaron Ardiri
AARDIRI@rim.com
twitter: @ARDIRI
Luca Filigheddu
LFILIGHEDDU@rim.com
twitter: @FILOS
Upcoming SlideShare
Loading in …5
×

Native Application (C/C++) on BlackBerry 10

2,121 views
1,830 views

Published on

Published in: Technology, Education
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,121
On SlideShare
0
From Embeds
0
Number of Embeds
23
Actions
Shares
0
Downloads
37
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • SWITCH TO KAMEL LAPTOP/PRESENTATION – 25-30mins
  • Martin will talk more about custom controls in
  • Native Application (C/C++) on BlackBerry 10

    1. 1. Native Application (C/C++) development on BlackBerry 10 Aaron Ardiri Principal Developer Evangelist AARDIRI@rim.com twitter: @ARDIRI
    2. 2. BlackBerry 10 SDKs C++/Qt Cascades C/C++ HTML5 BlackBerry® Native SDK WebWorks™ ActionScript Java Adobe® AIR® Android™ Runtime
    3. 3. Native SDK OSS & Developer Experience
    4. 4. Native SDK Hello World #include <stdio.h> #include <stdlib.h> int main(intargc, char **argv) { fprintf(stdout, “Hello World!n”); return EXIT_SUCCESS; }
    5. 5. Native SDK BlackBerry Platform Services the BlackBerry Platform Services (BPS) library provides an application with a single consistent interface to a number of different services during the execution of the application. • • • • • universal event management user interaction/navigator input/output (sensors, audio, LED, screen, multimedia) device information, locale and payment services network status and geo-location
    6. 6. Native SDK BlackBerry Platform Services bps_event_t *event_bps; event_bps = NULL; bps_get_event(&event_bps, timeout); // -1, forever if (event_bps != NULL) { event_domain = bps_event_get_domain(event_bps); if (event_domain == xxx) { // request event information within the domain } }
    7. 7. Native SDK BlackBerry Platform Services handling {service} events {service}_request_events({param}); // request events then capture the appropriate {service} events event_domain = bps_event_get_domain(event_bps); if (event_domain == {service}_get_domain()) { // handle the {service} event
    8. 8. NATIVE SDK: “HARDCORE” DEVELOPMENT VI, BASH &SSH DEBUGGING
    9. 9. Native SDK Open Industry Standards
    10. 10. Native SDK Open Source Support
    11. 11. CASCADES SDK
    12. 12. Cascades SDK OSS & Developer Experience
    13. 13. Mature C++ application framework Good APIs Signals and Slots Many help classes QML QtGui Cascades
    14. 14. Qt • Cross-platform application framework • Design GUI, Command line, Daemon Applications • More than a software development kit • Extends C++ (Meta Object Compiler) Cascades • Replacement for Qt UI Creation Kit (Qt Quick) • Libraries to access device hardware • Provides development tools (Cascades Builder)
    15. 15. Powerful toolkit with many components • QtNetwork Module • QtMedia Module • QtCore • C++ Extensions QtQuick • QtModeling Language (QML) • JavaScript based declarative language • Used in design of User Interface Applications Qt Creator • Aids in QML development
    16. 16. Replacement for QtQuick • Cascades UI rendering is NOT on the main thread! Features • Provides BlackBerry Look and Feel • Provides advanced placement management of components • Supports multiple resolutions • Supports orientation changes (Landscape vs Portrait) Uses QML • Replaces Qt Creator • QNX Momentics IDE Plugin – Cascades Builder
    17. 17. CascadesSDK Hello World import bb.cascades 1.0 Page { content: Label { text: "Hello World" } }
    18. 18. Cascades SDK Hello World Page* root = new Page; Label* label = Label::create() .text("Hello World"); root->setContent(label); Application::instance()->setScene(root);
    19. 19. 60 FPS!
    20. 20. UI in separate thread App logic 28 Cascades Photos by rumpleteaser and whologwy Flickr
    21. 21. Scene Graph Root Container Hello World RotationZ Scale Opacity Container Text: “Hello World”
    22. 22. Scene Graph Designing UI with QML • QML User Interfaces built on Object-Tree Model • Need a root node Typical root nodes • Anything that subclasses AbstractPane • Page – individual screen within an application • NavigationPane • TabbedPane Container – contains multiple UI objects • Used for custom components
    23. 23. In QML Container { opacity: 0.5 scaleX: 1.5; scaleY: 1.5 rotationZ: 45 ImageView { … } Label { … } }
    24. 24. C++ Container *bubble= new Container(); bubble->setOpacity(0.5f); bubble->setScale(1.5f); bubble->setRotationZ(45); bubble->add(ImageView::create() ... ); bubble->add(Label::create() ... ); …
    25. 25. Events Qt uses signals&slots paradigm Cascades events are mapped to Qt signals
    26. 26. Handling Touch Events in QML Container { onTouch: { if (event.isDown()) { scaleX = 2; scaleY= 2; rotationZ = 45; } else if (event.isUp()){ scaleX = 1; scaleY= 1; rotationZ = 0; } } … }
    27. 27. Handling Touch Events in C++ QObject::connect(bubble,SIGNAL (touch(bb::cascades::TouchEvent*)) this,SLOT (touched(bb::cascades::TouchEvent*)) ); touched(bb::cascades::TouchEvent *t) { if (t->isDown()) { bubble->setScale(2f); bubble->setRotation(45.0f); } else if (t->isUp()) { bubble->setScale(1f); bubble->setRotation(0.0f); } } }
    28. 28. C++ QML You can choose! No difference between UI created in QML or C++ They can be combined Typically, UI in QML and business logic in C++ QML supports JavaScript for signal handling
    29. 29. Animations Any Cascades UI element can be animated Animations are “running” on the engine thread Remember the client server setup? Explicit&Implicit animations: translation, rotation, scale, opacity, …
    30. 30. Core Controls
    31. 31. Custom controls
    32. 32. Custom Controls SpeedGauge Container DockLayout RotationZ (-0) TranslationY (30) RotationZ (-40) TranslationY(3 0)
    33. 33. Standard List Items
    34. 34. Custom list items
    35. 35. Data Binding SQL XML JSON Anyth ing
    36. 36. StackLayout&DockLayout
    37. 37. Pages, Panes and Navigation
    38. 38. CASCADES SDK: “PLEASING” DEVELOPMENT IDE, GUI, REAL-TIME UPDATES
    39. 39. For More Information… developer.blackberry.com/cascades
    40. 40. Thanks! Aaron Ardiri AARDIRI@rim.com twitter: @ARDIRI Luca Filigheddu LFILIGHEDDU@rim.com twitter: @FILOS

    ×