435
MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source: https://developer.blackberry.com/cascades/documen

MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

Embed Size (px)

Citation preview

Page 1: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura

Source: https://developer.blackberry.com/cascades/documentation/

Page 2: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 2

OVERVIEW

• Introduction• BlackBerry Enterprise Server• Basics in BB10 and IDE• BlackBerry 10 Concepts• Cascades• GUI• Invocation Framework• Cards• Menu-Integration• Data Storage• Communication• Location Services• More ...

Page 3: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 3

INTRODUCTION: BB10

Page 4: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 4

WHAT IS BLACKBERRY10 (BB10)

• BlackBerry 10 is an operation system for mobile devices

• Based on QNX• QNX was bought in 2010 by BlackBerry

(vormals Research in Motion)• Micro Kernel Betriebssystem• First used by BlackBerry in the BlackBerry

PlayBook (BlackBerry Tablet OS)Quelle: http://www.qnx.com

Page 5: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 5

DIFFERENCE TO MONOLITHIC KERNEL

• Most components run in their own processes• Each process runs in its own area

Process A

Process A

Process B

Process B

Memory of Process BMonolithic Kernel

Micro Kernel

Overwrite

Overwrite

Close process Quelle: Embedded systems security, by Kleidermacher and Kleidermacher, Elsevier 2012

Page 6: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 6

ADVANTAGES AND DISADVANTAGES

• Advantages – If a component crashes, the system stays alive– Drivers must not be a part of the kernel

• Disadvantages– Performance, a lot of context changes are

necessarly– Synchronize of the processes

Page 7: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 7

DIFFERENCE TO OTHER PLATFORMS

• Competitors:– iOS– Android– Windows Phone– Symbian

Page 8: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 8

DIFFERENCE TO OTHER PLATFORMS

• Unterschied zu anderen PlattformenAndroid iOS BlackBerry OS

BlackBerry 10Windows Phone

Symbian

Language Java, C++ Objective C Java ME, C++ C# C++, Java ME

Models 900+ 11 60+ 21 1000+

Available Apps (Feb. 2013)

845 000+ 770 000+ 100 000+ 120 000+ 115 000+

Advantages Open Source, a lot of examples and code

A few devices, Good API

Good support, fast growing market

Small amount of Apps, good support, few devices

High market penetration

Disadvantages

Many apps, a lot of different devices

Many Apps, restrictive market policy

Small API, documentation

Low market penetration

A lot of differnt devices

Page 9: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 9

BLACKBERRY10 PLATFORM

• Up to now, you had to use Java to develop for BlackBerry

• Now:

Adobe Air

Cascades / QT

Native / C++HTML 5

Android Emulator

Source: https://developer.blackberry.com/develop/platform_choice/index.html

Page 10: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 10

THE „OTHERS“

• HTML– Webworks, JavaScript and HTML based

• Adobe Air– Actionscript / Flex based

• Android Emulator– Java/Android based, Android 2.3.3

Page 11: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 11

CASCADES VS NATIVE

Cascades• QT/C++• A lot of BB10 APIs• Fast development• GUI is seperated from

logic

Native• Fast porting of existing

C++ / openGL applications

• Longer development process

• Pure „code“• POSIX compliance• Simple integration of

OpenSource LibrariesQuelle: https://developer.blackberry.com/develop/platform_choice/ndk.html

Page 12: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 12

CASCADES

• Supported by tat• Integrated Animations• Interface to Photoshop

– Direct export from Photoshop to QML• Simple communication with C++ classes• Native Multi-Language support• Qt integragted• Eclipse GUI Plugin• Hard to port applications• A little bit less performance than pure native• More information:

https://developer.blackberry.com/cascades/

Page 13: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 13

BLACKBERRY ENTERPRISE SERVERIng. Elmar Jilka, MSc

Page 14: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 14

BASICS: BB10 PROGRAMMING AND GUI

Page 15: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 15

COMPONENTS OF A BB10 CASCADES APPLICATION

• A Cascades Application has 3 parts:– bar-descriptor.xml– main.cpp– .qml File

Page 16: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 16

DAS BAR-DESCRIPTOR.XML

• Descriptes the basics of an application – Name– ID– Versionsnumber– Author– Plattform– Icon– Splashscreen– Application Files– Permissions

Page 17: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 17

MAIN.CPP

• Startpoint of each BB10 Cascades Application• It can consist of the application itself or call an

object, inherit from application

Page 18: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 18

.QML LAYOUT FILE

• A QML File describes a layout• Save it in the assets folder• A layout should have at least one component• Define the mayor layout in the first file

Page 19: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 19

FLOW

• User is king !• Organize the information in a

logical way• What will the user do next ?• Adapt the menu to the current

screen• Invoke other applications and

funcitons• Use shortcuts Source: https://developer.blackberry.com/cascades/documentation/

Page 20: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 20

BASIC ELEMENTS

• BB10 has 2 typical sctructures– Tabs– Drill-Down (Navigation Pane)

• It is possible to combine both

Source: https://developer.blackberry.com/cascades/documentation/

Page 21: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 21

TABS

• Using tabs, it is possible to access screens directly

• 4 Tabs can be placed on the bottom bar

• There is more space in the sidebar

Source: https://developer.blackberry.com/cascades/documentation/

Page 22: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

22

DRILL-DOWN

• Drill-Down (Navigation Pane) a hierachical structure of screens

• Screens are pushed over each other

Source: https://developer.blackberry.com/cascades/documentation/

Page 23: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

23

RESOLUTIONS

?Source: https://developer.blackberry.com/cascades/documentation/

Page 24: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 24

HANDLING DIFFERENT RESOLUTIONS (10.1)

Verschiedene Auflösungen

Ein Layout für alle

Anpassung per relativem

Layout

Scrollview

Dynamische Skalierung

Pro Auflösung ein Layout

Ordner mit Layout für

720x720

1280x768

1280x720

Page 25: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 25

KEYBOARD

• There are physical (Q10) and virtual keyboards

• Since 10.1 both types should be supported

• Use shortcuts for physical keyboards

• Think about the space for a virtual keyboard

Source: https://developer.blackberry.com/cascades/documentation/

Page 26: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 26

BASICS

• Everything in QML is possible in C++• But not everytihng in C++ is possible in QML• Simple GUI Elements:– Button– Label– TextField– CheckBox– ToggleButton– Slider

Page 27: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 27

GENERATE THE GUI

• Using QML

• Using C++

Page 28: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 28

CASCADES EVENT SYSTEM

• Signals & Slots (Qt based)• Every GUI interaction emits a Signal, which can

be connected to n slots

Click on Button

N obects,Are connected to a signal

Signal

Slot

Slot

Slot

Page 29: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 29

LAYOUTS

• There are threee kinds of layouts

Stack Layout Dock Layout Absolute Layout

Source: https://developer.blackberry.com/cascades/documentation/

Page 30: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 30

QML AND C++ INTEGRATION

• Load QML from C++

Source: https://developer.blackberry.com/cascades/documentation/

Page 31: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 31

CHANGE QML ATTRIBUTES PROGRAMMATICALLY

• It is simple to change QML attributes from C++

QML Code

Page 32: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 32

QML ATTRIBUTES

Page 33: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 33

USING C++ VALUES IN QML

• Connection with a QDeclarativePropertyMap

Registrier the Mapin QML

Page 34: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 34

ACCESS CUSTOM OBJECTS IN QML I

• It is possible to acces C++ objects from QML

Page 35: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 35

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• It is possible to acces C++ objects from QML

Macro for Qt Signals / Slots

Page 36: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 36

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• It is possible to acces C++ objects from QML

Variablename in QML

Page 37: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 37

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• It is possible to acces C++ objects from QML

Called, when the variable is read

Page 38: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 38

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• It is possible to acces C++ objects from QML

Called, when the variable is changed in QML

Page 39: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 39

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• It is possible to acces C++ objects from QML

Signal to emit

Page 40: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 40

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• Es kann auch ein eigenes Objekt in QML verwendet werden

Variablename in QML Called, when the variable is read

Called, when the variable is changed in QML

Signal to emit

Page 41: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 41

ZUGRIFF AUF CUSTOM OBJECTS IN QML I

• Es kann auch ein eigenes Objekt in QML verwendet werden

Function used in QML

Page 42: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 42

ZUGRIFF AUF CUSTOM OBJECTS IN QML II

• Register the C++ object to use it in QML

• It is simple to access values from the object in QML

Page 43: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 43

INSTALLATION OF THE IDE

Page 45: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 45

CODE SIGNING KEYS

• Order Code Signing Keys :– https://www.blackberry.com/SignedKeys/

codesigning.html• Important: Backup the keys !

Page 46: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 46

SIMULATOR DOWNLOAD AND INSTALL

• Download the simulator– https://developer.blackberry.com/develop/

simulator/index.html

Page 47: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 47

START IDE

Page 48: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 48

IDE - MENU

Menü

Page 49: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 49

IDE – DIRECTORIES AND FILES

Projects and files of the projects

Page 50: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 50

IDE – FUNCTIONS AND VARIABLES

Functions and variables

Page 51: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 51

IDE - INFORMATION

Information

Page 52: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 52

IDE - ACTIONS

Actions

Page 53: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 53

IDE ACTIONS

Choose SDK Version

Page 54: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 54

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Page 55: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 55

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Neues Projekt, neue Klasse,

neues Sourcefile anlegen

Page 56: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 56

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Neues Projekt, neue Klasse,

neues Sourcefile anlegen

Projekt kompilieren

Page 57: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 57

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Neues Projekt, neue Klasse,

neues Sourcefile anlegen

Projekt kompilieren

Konfiguration ändern

Page 58: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 58

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Neues Projekt, neue Klasse,

neues Sourcefile anlegen

Projekt kompilieren

Konfiguration ändern

Debugging starten

Page 59: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 59

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Neues Projekt, neue Klasse,

neues Sourcefile anlegen

Projekt kompilieren

Konfiguration ändern

Debugging starten

Ausführen ohne

Debugging

Page 60: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 60

IDE ACTIONS

SDK Version wählen

SDK Version nachladen

Neues Projekt, neue Klasse,

neues Sourcefile anlegen

Projekt kompilieren

Konfiguration ändern

Debugging starten

Ausführen ohne

Debugging

Sicht ändern

Page 61: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 61

IDE - VIEWS

• Application Profiler• QML Editing• C++ Editing• Debug• System Information

Page 62: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 62

QML EDITOR

Cascades Components

QML Code

Schematic layout

QML Eigenschaften

Page 63: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 63

SYSTEM INFORMATION

Target

Code

Target Information

Page 64: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 64

SYSTEM INFORMATION - SUMMARY

Page 65: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 65

SYSTEM INFORMATION – PROCESS INFO

Page 66: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 66

SYSTEM INFORMATION – MEMORY INFO

Page 67: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 67

SYSTEM INFORMATION – MALLOC INFO

Page 68: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 68

SYSTEM INFORMATION – FILE EXPLORER

Page 69: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 69

FIRST BB10 APP

Page 70: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 70

FIRST APP

• Installation done?• Keys ordered?• Simulator installed?• Device in Developer Mode?– (Settings / Security and Privacy /

Developermode)

Page 71: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 71

STEPS

• Create a new project• Signing Keys• Backup the Signing Keys• Connect Device• Create Debug Token• Deploy and debug the application

Page 72: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 72

CREATE A NEW PROJECT

Page 73: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 73

CREATE A NEW PROJECT

Page 74: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 74

CREATE A NEW PROJECT

Page 75: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 75

SIGNING KEYS AND CERTIFICATE

Unter Windows: Extras -> Einstellungen

Page 76: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 76

SIGNING KEYS AND CERTIFICATE

Page 77: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 77

SIGNING KEYS AND CERTIFICATE

Register the Signing Keys

Page 78: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 78

SIGNING KEYS AND CERTIFICATE

Generate the developer certificate

Page 79: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 79

SIGNING KEYS AND CERTIFICATE - BACKUP

Backup keys

Page 80: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 80

CONNECT THE DEVICE/SIMULATOR

• Connect the device via Micro USB or start the simulator

• To start the simulator use VMWare Fusion• Connect the device with the IDE

Page 81: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 81

START DEBUGGING

Page 82: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 82

START DEBUGGING

Page 83: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 83

START DEBUGGING

Activate and click apply

Page 84: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 84

START DEBUGGING

Start Debugging

Page 85: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 85

START DEBUGGING

Page 86: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 86

START DEBUGGING

Page 87: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 87

THE DEBUGGING VIEW OPENS

• Open the device log

messesage Project ID Process ID

Page 88: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 88

APPLICATION STOPS AT THE „BREAK POINT“• The applications stops at the beginning or the first

break-point

• To resume the application press F8 or the Software key• Shortcuts:

– F5 : Step Into– F6 : Step over– F7 : Step return

Page 89: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 89

EXC1

• Erzeugen Sie in der „Hello World“ Applikation ein zweites Textfeld

• Dieses soll in roter Schrift oben-mittig platziert sein

• Rotieren Sie das erste, schwarze Textfeld um 90° gegen den Uhrzeigersinn

• Geben Sie den Textfeldern IDs:– lblSchwarz– lblRot

Page 90: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura

Page 91: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 91

BLACKBERRY 10CONCEPTS

Page 92: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 92

USE C++ CLASSES IN QML

• Yesterday, the object was generated in C++ and used in QML

• But it is also possible to generate an object in QML

Source: https://developer.blackberry.com/cascades/documentation/

Page 93: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 93

USE C++ CLASSES IN QML

• The object must be registered and can be used in QML directly

Page 95: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 95

extends

Page 100: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 100

HOW CAN WE ACCESS C++ FROM QML ?

Page 101: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 101

HOW CAN WE ACCESS C++ FROM QML ?

1. Create C++ Object in QML– Register Class in QML, create the object in C++

2. Pass a C++ Object to QML– Create object in C++, pass it to qml

3. Using the PropertyMap (Gleich 2.) – Generate a PropertyMap and push it to QML

Page 102: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 102

HOW CAN WE ACCESS QML FROM C++ ?

Page 103: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 103

HOW CAN WE ACCESS QML FROM C++ ?

1. C++ Objekt nach QML übergeben– Objekt in C++ erzeugen, Objekt nach QML

übergeben

2. Property direkt im Code ändern– Das Objekt aus dem Root-Objekt extrahieren und

die Property setzen

Page 104: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 104

APPLICATION LIFETIME

Page 105: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 105

APPLICATION LIFETIME

Source: https://developer.blackberry.com/cascades/documentation/

Page 106: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 106

APPLICATION LIFETIME

• Each application runs through the cyclus• At the moment it is not possible to generate

an application without a GUI (should be possible with 10.2)

• An application in the „background“ is alwaysa visible as an „Active Frame“

• If the permission „run in background“ is enabled, the „stopped“ state does not exist

Page 107: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 107

APPLICATION LIFETIME

• Each application has 3 different states:– Fullscreen– Thumbnail– Invisible

Source: https://developer.blackberry.com/cascades/documentation/

Page 108: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 108

APPLICATION LIFETIME

• Each application has 3 different states:– Fullscreen– Thumbnail– Invisible

Source: https://developer.blackberry.com/cascades/documentation/

Page 109: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 109

APPLICATION LIFETIME

• Each application has 3 different states:– Fullscreen– Thumbnail– Invisible

Source: https://developer.blackberry.com/cascades/documentation/

Page 110: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 110

CASCADES ❤ JAVASCRIPT

Page 111: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 111

CASCADES ❤ JAVASCRIPT

• JavaScript can be used in QML• Inline Code• Using an external library• Usually JavaScript is used to react on signals

Source: http://www.crackberry.com

Page 112: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 112

JAVASCRIPT IN CASCADES

Page 113: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 113

INLINE JAVASCRIPT IN CASCADES

Signal

JavaScript

Page 114: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 114

JAVASCRIPT IN CASCADES - FUNKTION

JavaScript

Page 115: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 115

JAVASCRIPT IN CASCADES - FUNKTION

Page 116: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 116

CONNECT A SIGNAL TO A JAVASCRIPT FUNCTION

Page 117: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 117

CONNECT A SIGNAL TO A JAVASCRIPT FUNCTION

Signal Function

Page 118: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 118

CONNECT A SIGNAL TO A JAVASCRIPT FUNCTION

Is there an equal way doing it ?

Page 119: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 119

CONNECT A SIGNAL TO A JAVASCRIPT FUNCTION

onClicked:{root.changeTest();

}

Page 120: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 120

GUI ELEMENTS

Page 121: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 121

BASICS ON GUI ELEMENTS

• QML Components are always on the same level in a container

• Each component can have properties and signals

• Use JavaScript to react on signals

• You can design your own components

Page 122: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 122

BASICS ON GUI ELEMENTSCo

mpo

nent

s

Property

Additional objects

Page 123: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 123

BASICS ON GUI ELEMENTS

Property

Signal

Com

pone

nt

Page 124: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 124

GUI ELEMENTS- CONTAINER

• A Container is used to goupe other GUI elements

• Only a container can have childs• The alignement of the elements can be

adjusted in a container (Standard: StackLayout)

• Is a container deleted from a scene, all ist childs are deleted

Page 125: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 125

GUI ELEMENTS- CONTAINER

• The size of the container is defined by ist childs

• Width and height can be modified with:– preferredWidth, preferredHeight– minWidth, minHeight– maxWidth, maxHeight

• Usually the background is tranparent

Page 126: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 126

GUI ELEMENTS- CONTAINER

• Signals:– onControlAdded– onControlReplaced– onControlRemoved– onControlMoved– onLayoutChanged– onBackgroundChanged– onClipContentToBoundsChanged

Page 127: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 127

GUI ELEMENTS- CONTAINERCo

mpo

nent

s

Attached objects

Page 128: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 128

GUI ELEMENTS- LABEL

• A label is used to show a short text• Not interactive• The visual appearance (z.B. Color) is extended

by AbstractTextControl• Important properties:– text– multiline

• Important signals:– onMultilineChanged

Source: https://developer.blackberry.com/cascades/documentation/

Page 129: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 129

GUI ELEMENTS- BUTTON

• A button is an interactive GUI component• It is used for „click“ actions• Triggers actions• 3 different appearances:– Ein Bild und einen Text– Nur ein Text– Nur ein Bild

Source: https://developer.blackberry.com/cascades/documentation/

Page 130: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 130

GUI ELEMENTS- BUTTON

• Important signal– onClicked (extended by AbstractButton)

• Properties– imageSource– image– text

Page 131: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 131

GUI ELEMENTS- TEXTFIELD

• A TextField is an input field to interact with the user

• It can be configured for different kinds of inputs– eMail Adresse– Password– Chat– Url

Source: https://developer.blackberry.com/cascades/documentation/

Page 132: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 132

GUI ELEMENTS- TEXTFIELD

• Important Properties– hintText– inputMode– validator– Input (Mit TextInputProperties)

• submitKey• flags (Spellcheck, PredictionOff)

• Important signals– onTextChanging– onValidatorChanged

Page 133: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 133

GUI ELEMENTS- SLIDER

• A Slider enables the user to select a value from a defined range

• It is better to use a Slider instead of a TextField• Intuitive• Important properties– fromValue– toValue– value

• Important signal– onValueChanged

Page 134: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 134

GUI ELEMENTS– SEGMENTED CONTROL

• A horizontal selector for up to 4 different actions

• Is used to change the view of the current page• Important property– selectedIndex

• Important Signal– onSelectedIndexChanged

Source: https://developer.blackberry.com/cascades/documentation/

Page 135: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 135

GUI ELEMENTS– SCROLL VIEW

• A ScrollView is related to the Containers• It enables scrollig and zooming• Like all other components, a single element in

a ScrollView is allowed (But you can use a Container in it)

• Important properties– content– scrollViewProperties

Page 136: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 136

GUI ELEMENTS– IMAGEVIEW

• The ImageView is used to display images• A ScrollView is used for pitch-to-zoom• Important properties– scalingMethod– imageSource

Page 137: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 137

GUI ELEMENTS– WEBVIEW

• There are a lot of use cases, where it is necessary to show html or load external websites

• It is possible to load locale content and external content

• Important property– Html and/or url

• Important signals– onUrlChanged– onLoadingChanged– onMessageReceived

Page 138: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 138

GUI ELEMENTS– WEBVIEW

• html:

• url:

Page 139: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 139

GUI ELEMENTS– WEBVIEW

• Cascades can communicate with JavaScript in a WebView

• JavaScript must be enabled in the WebView• Messages are used for the communication• postMessage is used to sent a message to JavaScript,

which is embedded in a WebView• onMessageReceived is used to receive a message from

an embedded Javascript

Page 140: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 140

GUI ELEMENTS– WEBVIEW

• JavaScript, which is embedded in a WebView, can react with onmessage() and postMessage

Page 141: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 141

GUI ELEMENTS– WEBVIEW

• JavaScript, which is embedded in a WebView, can react with onmessage() and postMessage

Page 142: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 142

WHY IS IT IMPORTANT TO COMMUNICATE WITH EMBEDDED JAVASCRIPT?

Page 143: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 143

WARUM MIT JAVASCRIPT KOMMUNIZIEREN?

• Integrate existing content fro the Internet to the application

• Use native GUI elements to trigger actions on a webpage

• Using native GUI elements is more intuitve• Fast Cross-Platform-Developing– 1 Update for all operation systems

Page 144: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 144

GUI ELEMENTS– ACTIVITY INDICATOR

• An ActivityIndicator is used to inform the user, that a background thread is working

• It is used (in difference to a progress bar), when the duration of the loading is unknown

• Important Properties– running

• Important Signals– onStarted– onStopped

• Functions– Start– Stop

Source: https://developer.blackberry.com/cascades/documentation/

Page 145: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 145

GUI ELEMENTS– ACTIVITY INDICATOR

Initalize the ActivityIndicator

Page 146: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 146

GUI ELEMENTS– ACTIVITY INDICATOR

Initalize the ActivityIndicator

Start the ActivityIndicator

Stop the ActivityIndicator

Page 147: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 147

GUI ELEMENTS– ACTIONITEM

• ActionItems are used to define additional actions

• These Actions can be for the whole Page or a specific component (Context Menu)

• Each Action can be defined with an icon and a text

• An ActionSet combines actions to a set Source: https://developer.blackberry.com/cascades/documentation/

Page 148: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 148

GUI ELEMENTS– ACTIONITEM - CONTEXTACTION

Source: https://developer.blackberry.com/cascades/documentation/

Page 149: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 149

GUI ELEMENTS– ACTIONITEM - CONTEXTACTION

Page 150: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 150

GUI ELEMENTS– ACTIONITEM - CONTEXTACTION

Page 151: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 151

GUI ELEMENTS– ACTIONITEM – PAGE ACTION

• ActionItems placed on a Page er used to define additional actions

• Important properties– ActionItem.placement

Source: https://developer.blackberry.com/cascades/documentation/

Page 152: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 152

APPLICATIONMENU

• The Application menu is not directly connected to a single page

• Usually settings and additional information about the application can be bound in the menu

• The menu is on the top• Swipe-down at the top shows/hides the menu• Important properties of the entries

– title– imageSource

• Important signal– onTriggered Source: https://developer.blackberry.com/cascades/documentation/

Page 153: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 153

APPLICATIONMENU

Source: https://developer.blackberry.com/cascades/documentation/

Page 154: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 154

APPLICATIONMENU

Page 155: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

155

ORIENTATION HANDLING

• There are two different orientations:– Portrait– Landscape

• Tablets usually use the landscape orientation• Smartphones usually use the portrait orientation

Hint: Q10:Portrait == Landscape Mode

Source: https://developer.blackberry.com/cascades/documentation/

Page 156: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

156

ORIENTATION HANDLING

• Define the usage of both orientations in the manifest

Source: https://developer.blackberry.com/cascades/documentation/

Page 157: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 157

ORIENTATION HANDLING

• Define the support in QML to react on orientation changes(when the GUI isloaded)

• Use the OrientationHandler to react on the orientation change

Page 158: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 158

ORIENTATION HANDLING

• onOrientationAboutToChange in the handler is used to react on changes

Page 159: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 159

ADD GUI ELEMENTS PROGRAMMATICALLY

• In some use cases it is necessary to add GUI elements programmatically

• Remember: Use containers to add elements on the same level

Source: https://developer.blackberry.com/cascades/documentation/

Page 160: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 160

ADD GUI ELEMENTS PROGRAMMATICALLY

• Add a container in QML and define a name for the obecjt

• Initialize the container in C++ and add the elements

Page 161: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 161

ADD GUI ELEMENTS PROGRAMMATICALLY

Page 162: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 162

BEISPIEL DER GUI ELEMENTE

Page 163: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 163

EX 1

• Create a new BlackBerry Cascades Projekt• Create a Button and a Label• Write 0 (zero) in the Label• If the button is clicked, increase the number in

the label by 1

Page 164: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 164

EX 1

• Write a function in JavaScript, which calculates the nth Fibonacci Number (If you do not know how to calculate the Fibonacci Numbers, search the internet)

• Generate a slider from 2 - 20• Generate an additional label• When the user changes the value with the

slider, calculate the nth Fiboncci Number and show it in the label

Page 165: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 165

HINT

Page 166: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 166

EX 2

• Download Lena– http://sipi.usc.edu/database/preview/misc/4.2.04.

png• Create a new Cascades Projekt• Create an ImageView with Lena• Create an ActionItem in the context of the

ImageView– Rotate the Image on each click on the action item

Page 167: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 167

EX 2

• Create an ActionItem for a Page-Action• If it is triggered, change the visibility of Lena– If Lena is visibile -> invisibile– If Lena is invisibile -> visibile

• Change the text of the ActionItem on each click („visible“ <-> „invisible“)

Page 168: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 168

EX 3

• Create a new BlackBerry Projekt with a Navigation Pane

• Study the sourcecode• Create a new Button and create an other Page

as a new qml file• If the new button is clicked, open the new

page• If there isn‘t a back button on the page, add it.

Page 169: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 169

EX 3

• Create on the new page a button, which opens another page

• Create an application menu with an ActionItem

• If it is triggered, pop all pages until the first page is reached

Page 170: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura

Page 171: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 171

RECAPITULATION

• Development in BB10– HTML– Native C++– Adobe Air– Cascades– Android Emulator

• Elements of an application– GUI in QML– Code in C++– Description Files (z.B. Mainfest)– Assets– You can use JavaScript in QML

Page 172: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 172

RECAPITULATION

• 2 types of applications– Drill-Down– Tabs

• Important GUI Elements– Container– Label– ImageView– Button– TextField

Page 173: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 173

RECAPITULATION

• Menus– Context Menu– Page Context Menu– Application Menu

• ActionItem

Page 174: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 174

RECAPITULATION

• Communication between QML and C++– Generate Object in C++ and pass it to QML– PropertyMap– Import C++ Class in QML and generate objects

Page 175: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 175

INVOCATION FRAMEWORK

Page 176: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 176

INVOCATION FRAMEWORK

• Use the invocation framework to call an other application

• Messages can be used to pass data• Configure your own application to be

invokable from other applications• It is possible to invoke an application without

knowing the name of the other application. Only the task is necessary

Page 177: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 177

INVOCATION FRAMEWORK

• An Invocation Request is the message sent to the system to inform the system that an application should be invoked

• Invocation Request can be used to inform another application about changes

• Attributes of a message– Target– Action– Data

Page 178: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 178

INVOCATION FRAMEWORK - ATTRIBUTE

• Target– Each target application has an unique identifier– The „reverse DNS“ scheme is used (eg

com.example.myapp)• Action– Descripts the task which should be done– To call an defined action, the „reverse DNS“ scheme is

used (eg com.example.myapp.VIEW)– There are some predefined actions– These actions start with bb.action.

Page 179: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 179

INVOCATION FRAMEWORK - ATTRIBUTE

• Data– Data is passed as MIME type or URI• URI describes where the data can be found• MIME type descripes the kind of data

– A small amout of data (< 16kb) can be sent directly, if the URI is data://local

– Own MIME Types start with application/vnd (eg application/vnd.mycompany.mydata)

Page 180: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 180

INVOCATION FRAMEWORK – BOUND VS UNBOUND INVOCATIONS

• Bound Invocation– Knwon target– Start a known

application directly• Unbound Invocation– Known task– If no task is defined,

the Invocation Framework calls bb.action.VIEW

Source: https://developer.blackberry.com/cascades/documentation/

Page 181: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 181

INVOCATION FRAMEWORK – BOUND INVOCATION

Quelle: http://devblog.blackberry.com/2012/11/bbm-invocation-framework/

Page 182: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 182

INVOCATION FRAMEWORK – UNBOUND INVOCATION

Quelle: http://supportforums.blackberry.com/t5/Cascades-Development/Open-browser-from-app/td-p/1952547

Page 183: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 183

INVOCATION FRAMEWORK – PROBLEMS SENDING DATA• A small amount of data can be sent directly• If the URI is used, be aware, that the called application

can access the data• If the called application cannot access the file directly, it

is copied to the called application‘s directory• It is possible to control this behaviour using the following

attributes:– Preserve– CopyReadOnly– CopyReadWrite– Link

Page 184: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 184

INVOCATION FRAMEWORK – MULTIPLE FILES• Sent multiple files, adapt the MIME type

– filelist/mixed– filelist/document– filelist/media

• If all files in the same directory, the URI is the path to this directory

• If the files are in different directories, a JSON with the paths is required

Page 185: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 185

INVOCATION FRAMEWORK – CORE APPLICATIONS

Quelle: http://supportforums.blackberry.com/t5/Cascades-Development/Open-browser-from-app/td-p/1952547

• A lot of the standard applications can invoked using the invocation framework

Page 186: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 186

INVOCATION FRAMEWORK – RECEIVING INVOCATIONS

• It is possible to receive Invocation Requests from other applications

• Therefore you have to define your application as a target in the bar-descriptor.xml (Manifest)

Page 187: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 187

INVOCATION FRAMEWORK – RECEIVING INVOCATIONS

• In addition, some lines of C++ code is required• The application have to known in which state

it was started

Page 188: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 188

Page 189: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 189

Connect to the InvocationManager

Page 190: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 190

React on the kind of start

Page 191: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 191

INVOCATION FRAMEWORK – TARGET FILTER

• Applications, which can do the job, will be identified by target filters

• These Filters are a part of <invoke-target> in the Manifest

• Attribute– Filter: Descripts the criteria of a filter– Action: The action, which can be called– MIME Type: The kind of file/data which can be opened– Uris: A scheme for the URI– Exts: the allowed extensions

Page 192: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 192

INVOCATION FRAMEWORK – TARGET FILTER• There are some rules:– The URI cannot only be a Wildcard-Character (*)– If bb.action.VIEW or bb.action.OPEN is defined as an

action and if the MIME type is a wildcard , the URI cannot be data:// or file://

– If URI equals to data:// or file:// and the MIME type is a wildcard, there must be at least an extension that is not a wildcard

• If a rule is violated, you are not able to install the application on the device (Error: 884 Restricted Invoke Filter)

Page 193: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 193

EXAMPLES TARGET FILTER

• Allowed– actions=bb.action.OPEN; types=*;uris=http://;– actions=bb.action.OPEN,bb.action.VIEW; types=*; uris=file://;

exts=jpg,gif,tif;– actions=bb.action.VIEW; types=*; uris=data://; exts=jpg,gif,tif;

• Not allowed– actions=bb.action.OPEN,bb.action.VIEW,bb.action.SET; types=*;

uris=file://;– actions=bb.action.OPEN; types=*; uris=data://;– actions=bb.action.VIEW; types=*; uris=*;– actions=bb.action.VIEW; types=*;– actions=bb.action.OPEN,bb.action.VIEW; types=*; uris=file://; exts=*;

Page 194: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 194

EXAMPLES TARGET FILTER

Page 195: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 195

EXAMPLES TARGET FILTER

2 Filter

Page 196: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 196

EXAMPLE TARGET FILTER

Filter for PNGor JPEG fileswhich are in thedata or in a message

Filter for a URI with the extension of .png or .jpg

Page 197: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 197

INVOCATION FRAMEWORK – HOW CAN THE FRAMEWORK DETERMINE THE RIGHT TARGET?

• If an unbound invoke is sent to the Invocation Framework, it tries to determine the right target (Process is called Invocation Brokering)

• An application is used in the process if ...– the action matches– every application used for the process, if no action

is defined

Page 198: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 198

INVOCATION FRAMEWORK – HOW CAN THE FRAMEWORK DETERMINE THE RIGHT TARGET?

• At this point the MIME type and URI schemes are compared– URI Schema is equal? (if the extension is set, only if it matches too)– MIME Type equal?

• Sorting the applications– Most matching URI scheme (from the number of matching

characteristics)– If there are equal filters, the MIME type is compared– An explicit match is better than a wildcard– If there are equal filters at this point, the URI extensions are

compared– If there are equal filters, the system default is used– If there is no system default, the oldest filter is used

Page 199: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 199

INVOCATION FRAMEWORK – CARD OR APPLICATION

• There are 2 options showing a preview– External application– Card

• The difference can be defined in the task:– Do you plan to make a „simple“ action with the

data and come back to the application ? -> Card– Do you want to process the data with a lot of

different methods and proceed working in the new application ? -> external application

Page 200: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 200

CARDS

Page 201: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 201

CARDS

• Cards can be used to provide the whole functionality or a part of it to another application

• Usually specialised tasks are used for cards• The card is pushed over the calling application

without closing it• An application can only call a single card by

the time. But a card can call another card

Page 202: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 202

CARDS - KINDS

• There are three kinds of cards:

Picker Composer Previewer

Source: https://developer.blackberry.com/cascades/documentation/

Page 203: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 203

CARDS - KINDS

• Picker– Pick existing content to use in the application (eg Files)

• Composer– Generate or edit existing content

• Previewer– Preview content

• The kind of the card defined the animation of the card and how peek is handled.

Page 204: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 204

CARDS – TRANSITION – COMPOSER AND PICKER

• The transition between the application and the card is defined by the kind

Source: https://developer.blackberry.com/cascades/documentation/

Page 205: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 205

CARDS – TRANSITION - PREVIEWER

Source: https://developer.blackberry.com/cascades/documentation/

Page 206: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

206

CARDS – PEEKING

• The Previewer support full peeking• The Composer and Picker only support

peeking on the action bar

Source: https://developer.blackberry.com/cascades/documentation/

Page 207: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 207

CARDS - DESIGN

• BlackBerry defines in the GUI Guidelines some rules

• Cards must support both orientations

Page 208: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 208

CARDS

• Cards are called using invocations• If the user closes the card, an signal is emitted and

can be used by the calling application• Previewer closes without an signal• Emitting the closing signal for a Composer is optional• Usually you want to have a closing signal when a

Picker is used• It is also possible to close a card from the calling

application

Page 209: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 209

CARDS - CODE

• React on peek

Page 210: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 210

CARDS - CODE

• React on response

Page 211: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 211

CARDS - REGISTER

• Card must be registered in the manifest

Page 212: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 212

CARDS - STARTMODE

• If an application is started, it must be identified, if the application was called by another application as a card or not

Page 213: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 213

Page 214: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 214

Connect to „invoked“ signal

Page 215: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 215

Is the application called as a card?

Page 216: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 216

CARDS - STARTMODE

• Wait for the „invoked“ signal and react on it

Page 217: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 217

CARDS – SEND A RESPONSE

• If the card is closed, you can/must provide dan response

Page 218: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 218

CARDS – RESIZE AND ORIENTATION

• Each card must support both orientations• It is possible, that the card is resized (eg if a

virtual keyboard is required). The card must react on these kind of changes

Page 219: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 219

Page 220: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 220

Connect to resize signal

Page 221: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 221

Function, which is called on an emitted signal

Page 222: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 222

EXAMPLES OF INVOCATIONS

Page 223: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 223

MENU INTEGRATION

Page 224: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 224

INTEGRATION IN THE CONTEXT MENU

• As we have learned, it is possible generate a context menu

• But it is possible that the operation system BB10 adds more elements automatically

• And what is even better:It is possible to be added in other applications as well

Page 225: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 225

INTEGRATION INS CONTEXT MENU

• „Normal“ integration in the contextmenu

• Integrate the selection of the operation system

• Which applications are integrated is decided by BB10 using the filters

Page 226: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 226

ACTIVE FRAME

Page 227: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 227

ACTIVE FRAME

• An Active Frame visual state of the thubnailed application

• The frame can be static or dynamic

• A simple static cover is better than a missing cover

• The cover itself cannot be interactive: if the user clicks on it, the application is going to the fullscreen state

Source: https://developer.blackberry.com/cascades/documentation/

Page 228: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 228

ACTIVE FRAME

• A dynamic active frame should be updated rarely

• Different resolutions require different active frames

• Sometimes less information is more ...

• Style: SlatePro, regular weight, 30px height

Source: https://developer.blackberry.com/cascades/documentation/

Page 229: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 229

ACTIVE FRAME – STYLE GUIDELINES

Source: https://developer.blackberry.com/cascades/documentation/

Page 230: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 230

ACTIVE FRAME – STYLE GUIDELINES

Source: https://developer.blackberry.com/cascades/documentation/

Page 231: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 231

ACTIVE FRAME - STATIC

• Register the components to use them in QML

• Generate the Cover for the active frame in QML

Page 232: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 232

ACTIVE FRAME - STATISCH

• Initialize the cover

• Set the cover

Page 233: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 233

ACTIVE FRAME - DYNAMIC

• Usually an dynamic active frame is set in C++• Be aware of the update cycles• The dynamic content must provide additional

information for the user• The first update can be triggers by calling

update() or by connect to the thumb nailed signal (preferred)

Page 234: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 234

ACTIVE FRAME - DYNAMIC

Page 235: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 235

ACTIVE FRAME - DYNAMIC

Load GUI from QML

Page 236: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 236

ACTIVE FRAME - DYNAMIC

Trigger first update

Page 237: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 237

ACTIVE FRAME - DYNAMIC

Page 238: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 238

ACTIVE FRAME - DYNAMIC

Trigger the update every 2 hours

Call the first update, when the appication

is thumbnailed

Page 239: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 239

ACTIVE FRAME – DYNAMIC- SET

Page 240: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 240

EXAMPLES OF ACTIVE FRAMES

Page 241: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 241

PROJECT

• Groups of 4• Think about a small project• Development time per person: 10 -15h• Kick Off Presentation on Thursday

– 5-10 min about your project– 1st Slide: Name of the group, members– Which steps do you need to reach your goal?– Who is responsible for which part ?– Which API do you want to use– Is there an equal application in the market? If there is an equal application, why is

your application „better“?• Send me your commented project until the 5th of July

– Source– Compiled BAR File– PDF with more information about your project (Members, goal, achievements)

Page 242: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 242

EX 1

• Create a new BB Cascades Projekt• Create 5 Buttons• Use the invocation framework to connect the clicked signal

from the buttons to:– Open a browser with orf.at– Create an eMail with: subject: „Hallo Composer“, text: „how are

you doing ?“– Open an image– Open the BlackBerry World– Generate a new „Remember“ message with: „VO nicht

vergessen“ and the description: „Das darf ich einfach nicht vergessen“

Page 243: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 243

EX 1

• Create another button• This button is used in Ex2

Page 244: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 244

EX 2

• Create a new BB Cascades Projekt• Create an ImageView• Set an Invoke Filter for this application• If the application is Invoked, the ImageView

should show the passed image.

Page 245: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 245

EX 2

• Add the following function to the additional button from Ex1– Start application from Ex2 with an image using the

invocation framework• Try to start application2 from the first

application

Page 246: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 246

EX 3

• Create a new BB Cascades Projekt• Generate a QML file for an active frame• Set the active frame for the application

• Additional:– Replace the static active frame with a dynamic

frame– Create a timer and count a number up in the

active frame

Page 247: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura

Page 248: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 248

RECAPITULATION

• Development in BB10– HTML– Native C++– Adobe Air– Cascades– Android Emulator

• Elements of an application– GUI in QML– Code in C++– Description Files (z.B. Mainfest)– Assets (wobei GUIs auch Assets sind)

• You can use JavaScript in QML

Page 249: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 249

RECAPITULATION

• 2 types of applications– Drill-Down– Tabs

• Important GUI Elements– Container– Label– ImageView– Button– TextField

Page 250: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 250

RECAPITULATION

• Menus– Context Menu– Page Context Menu– Application Menu

• ActionItem

Page 251: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 251

RECAPITULATION

• Communication between QML and C++– Generate Object in C++ and pass it to QML– PropertyMap– Import C++ Class in QML and generate objects

Page 252: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 252

RECAPITULATION

• ActiveFrame can be static and dynamic• Usually, dynamic frames are generated in C++• An ActiveFrame must support both

orientations and resizing• A lot of updates drain the battery

Page 253: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 253

DATA STORAGE

Page 254: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 254

CASCADES ACCES DATA

• Cascades has an advanced system access data• This system has different elements

Page 255: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 255

CASCADES ACCES DATA- ELEMENTE

Raw Daten, eg JSON

Page 256: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 256

CASCADES ACCES DATA- ELEMENTE

Access to the raw dataEg to generate new files

Page 257: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 257

CASCADES ACCES DATA- ELEMENTE

Adapter to connect the GUI to acces data from QML simple and

fast

Page 258: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 258

CASCADES ACCES DATA- ELEMENTE

Sorts and organizes the data to show it in the best way

Page 259: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 259

CASCADES ACCES DATA- ELEMENTE

The graphical representation of the

data

Page 260: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 260

FILE SYSTEM

• There are different permissions for different folders and files

• Data, which is deployed within the application, must be in the assets directory

• The „working directory“ (application root) is the directory where the application is executed

• It is not allowed to place any data in the „working directory“ programmatically

Page 261: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 261

FILE SYSTEM - STRUCTUR

Source: https://developer.blackberry.com/cascades/documentation/

Page 262: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 262

FILE SYSTEM - STRUCTUR

Application root (r)1

1 r = read w = write s = symbolic

Page 263: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 263

FILE SYSTEM - STRUCTUR

Installation directory (r)

1 r = read w = write s = symbolic

Page 264: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 264

FILE SYSTEM - STRUCTURBinary Files and other application ressources

(r)

1 r = read w = write s = symbolic

Page 265: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 265

FILE SYSTEM - STRUCTUR

Images, media files and qml documents (r)

1 r = read w = write s = symbolic

Page 266: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 266

FILE SYSTEM - STRUCTUR

The application has full access to this directory. It is application‘s

„Home“ directory (rw)

1 r = read w = write s = symbolic

Page 267: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 267

FILE SYSTEM - STRUCTUR

Databases (rw)

1 r = read w = write s = symbolic

Page 268: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 268

FILE SYSTEM - STRUCTUR

Log Files (r)

1 r = read w = write s = symbolic

Page 269: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 269

FILE SYSTEM - STRUCTURShared Folder: The subfolders contain the

shared files for all applications. If the

permission „access_shared“ is set, the application is allowed to write. (rws)

1 r = read w = write s = symbolic

Page 270: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 270

FILE SYSTEM - STRUCTUR

This folder contains data, which is shared with other applications

using the invocation framework (rw)

1 r = read w = write s = symbolic

Page 271: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 271

FILE SYSTEM - STRUCTUR

Temporary folder: This directory is used to save temporary files. QNX

can delete this directory, if the appication is closed (rw)

1 r = read w = write s = symbolic

Page 272: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 272

FILESYSTEM – WORKING DIRECTORY

• Different names– Application Root– Current Directory– Sandbox

• Access data using relative or absolute path– ./data– /accounts/1000/appdata/

namespace.application/data

Page 273: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 273

FILESYSTEM – WORKING DIRECTORY

• Access the directories using QDir• currentPath– Path to the Working Directory of the application

• homePath– Path to the data directory of the application

• tempPath– Path to the temp directory

Page 274: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 274

FILESYSTEM - ASSETS

• The assets directory is read only• If a non source code file should be deployed with the

application, it must be placed in the assets folder• If you try to change a file in the assets directory, it

must be copied to an other directory with the appropriate persmissions (eg ./data)

• The folder can be accessed from QML using „asset:///name“

Page 275: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 275

FILESYSTEM – ASSETS - EXAMPLE

• Example: An image should be packed with the application, changed when the application is called the first time and showed an the following starts of the application

Page 276: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 276

FILESYSTEM – ASSETS - EXAMPLE

• Example: An image should be packed with the application, changed when the application is called the first time and showed an the following starts of the application– Copy the image to ./data and then manipulate it– Or change the image and save it to ./data

Page 277: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 277

FILESYSTEM – ASSETS - EXAMPLE

• Example: An image should be packed with the application, changed when the application is called the first time and showed an the following starts of the application– Copy the image to ./data and then manipulate it– Or change the image and save it to ./data– When the application is started, check if the image

exists in ./data. If it exists, load it from ./data. Otherwise it must be loaded from the assets folder

Page 278: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 278

FILESYSTEM – READ/WRITE

• Before you can access a file, it must be checked if the parent directory exists.

• QDir can be used– Use QDir::cd(QString) to check if a directory exists– Use QDir::mkpath(QString) to generate a directory

and all its non-existing parent directories• Use QFile to access files

Page 279: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 279

FILESYSTEM – READ/WRITE

• Write

• Read

Page 280: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 280

JSON DATA

• JSON is often used to save data• Name:Value Pairs are saved or a batch of objects (more

information: http://www.json.org/)• It is possible to load JSON data and pass it to da

datamodel• For processing JsonDataAccess is used• Arrays are read as QVariantList• Objects are read as QVariantMap• The bb::data library is required for processing JSON

data (LIBS += -lbbdata)

Page 281: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 281

JSON - CODE

Page 282: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 282

JSON - CODE

Attributes of a JSON object

Generate the data model

Page 283: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 283

JSON - CODE

Load JSON

Page 284: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 284

JSON - CODE

Connect the datamodel with JSON

Page 285: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 285

JSON - QML

Page 286: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 286

XML DATA

• It is also possible to store data in a structured way using the XML scheme

• Is very common• Easier for humans to read• HTML is in the XML scheme• Accessing data in QML can be done using

XMLDataAccess• It is necessary to link against bb::data Library

(LIBS += -lbbdata)

Page 287: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 287

XML DATA

Source: https://developer.blackberry.com/cascades/documentation/

Page 288: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 288

XML DATA- CODE

Page 289: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 289

READ XML IN QML

Page 290: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 290

SQL - DATA

• It is better to store a higher amount of data in a „real“ database

• Tables• External and local databases• SqlDataAcces to access the data• The bb::data library is required (LIBS += -

lbbdata)

Page 291: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 291

SQL READ

Page 292: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 292

SQL WRITE

Page 293: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 293

SQL WRITE

Generate database

Page 294: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 294

SQL WRITE

Open database

Page 295: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 295

SQL WRITE

Connect to database

Page 296: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 296

SQL WRITE

Generate table and instert data

Page 297: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 297

DATASOURCE QML

• SQL, JSON or XML can be loaded using QML only• DataSource must be imported

• Local and external DataSource can accessed• A DataSource can be used to organize the data in

QML

Page 298: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 298

DATASOURCE QML – EXTERNAL XML

Page 299: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 299

GROUPEDATAMODEL

• This model is required to sort data for a list• It is possible to sort by different attributes• A combination of attributes is also possible– z.B. Name, Date of Birth

• The following data types cen be sort:Char, Date, Datetime, Double, Int, LongLong, String, Time, UInt, ULongLong, Url

Page 300: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 300

GROUPEDATAMODEL

• It is possible to group elments

Source: https://developer.blackberry.com/cascades/documentation/

Page 301: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 301

GROUPEDATAMODEL - QML

Page 302: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 302

GROUPEDATAMODEL - QML

Sort by:firstName

lastName, if the firstName is equal

Page 303: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 303

GROUPEDATAMODEL - QML

How should the entry look like?

Page 304: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 304

STANDARDLISTITEM

• A StandardListItem can have the following attributes– Image– ImageSource– Title– Status– Description

Source: https://developer.blackberry.com/cascades/documentation/

Page 305: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 305

STANDARDLISTITEM

• A StandardListItem can have the following attributes– Image– ImageSource– Title– Status– Description

Source: https://developer.blackberry.com/cascades/documentation/

Page 306: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 306

EXAMPLE: HOW TO READ A RSS FEED?

• RSS = XML• External source• Linking against –lbbdata is required• Register the type to use in QML• Generate DataSource and Groupmodel• Generate a list• Load• Done

Page 307: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 307

EXAMPLE: HOW TO READ A RSS FEED?

• RSS = XML• External source• Linking against –lbbdata is required• Register the type to use in QML• Generate DataSource and Groupmodel• Generate a list• Load• Done

Page 308: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 308

EXAMPLE: HOW TO READ A RSS FEED?

Page 309: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 309

EXAMPLE: HOW TO READ A RSS FEED?

Page 310: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 310

EXAMPLE: HOW TO READ A RSS FEED?

No grouping and sort by the date of publishing

url to the RSS feed and where the single items can

be found

Page 311: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 311

EXAMPLE: HOW TO READ A RSS FEED?

Page 312: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 312

EXAMPLE: HOW TO READ A RSS FEED?

/rss/channel/item

Page 313: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 313

EXAMPLE: HOW TO READ A RSS FEED?

If there is existing data, delete it and add the new

data

Page 314: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 314

EXAMPLE: HOW TO READ A RSS FEED?

Page 315: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 315

EXAMPLE: HOW TO READ A RSS FEED?

Connect the list with the DataModel

How a ListItem looks like

Page 316: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 316

EXAMPLE: HOW TO READ A RSS FEED?

Load RSS Feed

Page 317: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 317

EXAMPLE: HOW TO READ A RSS FEED?

Load RSS Feed

Page 318: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 318

COMMUNICATION

Page 319: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 319

NETWORKING

• In mobile computing it is in a lot of cases necessary to communicate with a server

• A request is sent to a server• A reply is received• It is necessary to allow the application access

the internet by setting the permission

Source: https://developer.blackberry.com/cascades/documentation/

Page 320: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 320

NETWORKING

Source: https://developer.blackberry.com/cascades/documentation/

Page 321: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 321

NETWORKING

Source: https://developer.blackberry.com/cascades/documentation/

Page 322: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 322

NETWORKING

Source: https://developer.blackberry.com/cascades/documentation/

Page 323: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 323

PUSH

• Push is used to send a small amount of data to n devices

• It is possible to push up to 8kb of data• A server distributes the push notification to n

devices• Usually push is used to inform the user about

new information• A new push message should be displayed using

notifications

Page 324: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 324

PUSH

1. The Content Provider sends Push-Request

2. The BlackBerry server replies3. The BlackBerry server sends data to the

devices4. The devices reply5. The BlackBerry server passes the replies

to the Content Provider6. The Content Provider approves the

receiving of the replies

Source: https://developer.blackberry.com/cascades/documentation/

Page 325: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 325

PUSH

• It is possible to send a message to– A single device (unicast)– All registered devices (broadcast)– A part of the registered devices (multicast)

• It is better to use push, than pulling content in the background

• BIS (BlackBerry Internet Service) BES (BlackBerry Enterprise Service) Push

• To use BIS push, an application must be registered

Page 326: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 326

PUSH - MANIFEST

• Permessions to receive push messages

• Using the invocation framework, the application is startet with the pushed data

Page 327: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 327

PUSH - MANIFEST

• Permissions to receive push messages

• Using the invocation framework, the application is started with the pushed data

Using the bb.action.push, it is possible to identify, that the application was started using

push

Page 328: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 328

PUSH - MANIFEST

• To start the application, when the notification is clicked:

Page 329: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 329

PUSH - MANIFEST

• To start the application, when the notification is clicked:

The BlackBerry Hub tries to launch BB_OPEN_INVOCATION_ACTION, which is equal to bb.action.OPEN

Page 330: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 330

PUSH - CODE

• If BB10 receives a push notification, it passes it to the registered application

• The application decides what happens with the message

Page 331: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 331

PUSH - CODE

• If BB10 receives a push notification, it passes it to the registered application

• The application decides what happens with the message

If a push notification is send to the application, a notification in the hub

can be initialized

Page 332: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 332

PUSH - CODE

• If the user clicks on a notification in the BlackBerry Hub the application is invoked using BB_OPEN_INVOCATION_ACTION

Page 333: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 333

PUSH - CODE

• If the user clicks on a notification in the BlackBerry Hub the application is invoked using BB_OPEN_INVOCATION_ACTION

The application was called form the Hub using an invocation from a

notification

Page 334: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 334

NOTIFICATIONS

• Notifications are used to inform the user about an incoming event

• An event can be e.g. a message, an update, ...

Source: https://developer.blackberry.com/cascades/documentation/

Page 335: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 335

SET A NOTIFICATION PROGRAMMATICALLY

• It is easy so set an notification programmatically

Page 336: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 336

SET A NOTIFICATION PROGRAMMATICALLY

• It is easy so set an notification programmatically

Initialize the notification

Set title and text

Initialize the invocation

Sent the notification to the BlackBerry Hub

Page 337: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 337

DELETE A NOTIFICATION

• You should delete the notification from the hub, if it was consumed

• Single notification

• All notifications

Page 338: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 338

NOTIFICATION - QML

• Notifications can be initializied using WML• Configure it:

• And deliver it to the hub

Page 339: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 339

EX 1

• Create a new BB Cascades Projekt• Create a txt file in the assets folder• Generate 2 buttons• If Button1 is clicked, load the content of the

textfile and save it to a QString• Show the content in a textarea (editable)• If Button2 is clicked, copy the content of the

textarea to a new file in the shared documents folder

Page 340: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 340

EX 2

• Create a new BB Cascades Projekt• Read the RSS Feed from the FH Hagenberghttp

://www.fh-ooe.at/index.php?id=94&type=100• Show the title and publisher date in a list• Sort the list by publishing date• Optional: group the entries by categories

Page 341: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 341

EX 3

• Create a new BB Cascades Projekt• Create 2 Buttons• If button1 is clicked, generate a notification

and send it to the hub• If button2 is clicked, dismiss the notifications

Page 342: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura

Page 343: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 343

RECAPITULATION

• Development in BB10– HTML– Native C++– Adobe Air– Cascades– Android Emulator

• Elements of an application– GUI in QML– Code in C++– Description Files (z.B. Mainfest)– Assets (wobei GUIs auch Assets sind)

• You can use JavaScript in QML

Page 344: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 344

RECAPITULATION

• 2 types of applications– Drill-Down– Tabs

• Important GUI Elements– Container– Label– ImageView– Button– TextField

Page 345: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 345

RECAPITULATION

• Menus– Context Menu– Page Context Menu– Application Menu

• ActionItem

Page 346: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 346

RECAPITULATION

• Communication between QML and C++– Generate Object in C++ and pass it to QML– PropertyMap– Import C++ Class in QML and generate objects

Page 347: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 347

RECAPITULATION

• ActiveFrame can be static and dynamic• Usually, dynamic frames are generated in C++• An ActiveFrame must support both

orientations and resizing• A lot of updates drain the battery

Page 348: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 348

RECAPITULATION

• The file system has three different areas– Shared– Shared Invoke– Application area

• The different areas have different permissions• It is possible to access XML, JSON and SQL from QML

directly• DataSources are used to get content• The DataModel organizes and sorts the data• Lists are used to show content

Page 349: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 349

RECAPITULATION

• A small amount of data can be sent to a device / devices using push

• Applications can be called using a push message• In the hub push messages can be showed as a

notification• Notifications are visible in the hub• On click on a notification an invoke is sent to

the invocation framework

Page 350: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 350

COMMUNICATION

Page 351: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 351

NFC (NEAR FIELD COMMUNICATION)

• A lot of mobile devices have NFC • It is possible to exchange data in a short range• NFC can be used C++ and Cascades/Qt• Not all interfaces can be found in Cascades/Qt• Simpler using Cascades/Qt• Best way: Invocation Framework

Page 352: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 352

NFC – INVOCATION FRAMEWORK

• Usually NFC is used to exchange simple data

• NFC Share Card using Invocation

• Action for the Invocation: bb.action.SHARE

• If the user chooses NFC, a preview of the content is shown

Source: https://developer.blackberry.com/cascades/documentation/

Page 353: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 353

NFC – INVOCATION FRAMEWORK

• If the sent data is too big using NFC, a Bluetooth handshake is initialized

• The content is submitted using Bluetooth

• Files are always sent using Bluetooth

• Data can be sent using NFCSource: https://developer.blackberry.com/cascades/documentation/

Page 354: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 354

NFC – INVOCATION FRAMEWORK: FILE

Source: https://developer.blackberry.com/cascades/documentation/

Page 355: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 355

NFC – INVOCATION FRAMEWORK: DATA

Page 356: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 356

NFC – INVOCATION FRAMEWORK: SQUENCEDIAGRAM

Source: https://developer.blackberry.com/cascades/documentation/

Page 357: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 357

NFC – INVOCATION FRAMEWORK DATA

• Direct connection, if data < 1 kb• If the receiving device can handle the

incoming data• Sender:– mimeType = application/vnd.rim.nfc.ndef– uri is empty– data = <byte array representation of custom NDEF

message>– action = bb.action.SHARE

Page 358: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 358

NFC – INVOCATION FRAMEWORK DATA

• Receiver:– Registered with the Invocation Framework

bb.action.OPEN– mimeType = application/vnd.rim.nfc.ndef– uri = <filter>, z.B. <property var="uris"

value="ndef://1/Sp"/>

Page 359: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 359

NFC – INVOCATION FRAMEWORK DATA

• Data should be sent to a known application (z.B. Browser)– mimeType = “text/plain” or mimeType =

“text/URI-list”– uri is Empty.– data = <text representation of your payload>– action = bb.action.SHARE

Page 360: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 360

NFC – INVOCATION FRAMEWORK DATA

• NDEF schemes known by BlackBerry:

Page 361: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 361

NFC – INVOCATION FRAMEWORK EXAMPLE DATA

Page 362: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 362

NFC – INVOCATION FRAMEWORK EXAMPLE DATA

Page 363: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 363

NFC – INVOCATION FRAMEWORK FILE

• mimeType = <your custom mime Type>. Example:application/myapp1.

• uri = <URI encoded string to a local file located on sending device>. Example: file:///shared/myapp1/sound1.mp3

• data = “”• action = bb.action.SHARE

Page 364: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 364

NFC – INVOCATION FRAMEWORK EXAMPLE FILE

Page 365: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 365

NFC – CASCADES/QT

• Using Data or File• NfcShareManager• You have to inform the user about the

different steps• It is necessary to handle alle sharing events

Page 366: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 366

NFC – CASCADES/QT: DATA

Source: https://developer.blackberry.com/cascades/documentation/

Page 367: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 367

NFC – CASCADES/QT: FILE

Source: https://developer.blackberry.com/cascades/documentation/

Page 368: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 368

NFC – CASCADES/QT: SEND

• It is possible to share data and files– NfcShareDataContent– NfcShareFilesContent

Page 369: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 369

NFC – CASCADES/QT: SEND

• It is possible to share data and files– NfcShareDataContent– NfcShareFilesContent

Page 370: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 370

NFC – CASCADES/QT: SEND

• Data is passed to NfcShareManager• Data is valid until– Is was used– the ShareMode is set to disabled

Page 371: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 371

NFC – CASCADES/QT: SEND

• Data is passed to NfcShareManager• Data is valid until– Is was used– the ShareMode is set to disabledExample to share data

Page 372: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 372

NFC – CASCADES/QT: SEND

Page 373: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 373

NFC – CASCADES/QT: SEND

In difference to sending data, uri is passed here.

Bluetooth will be activated and the data is sent using it

Page 374: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 374

NFC – CASCADES/QT: RECEIVE

• To receive a NFC invocation, register the application

Page 375: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 375

NFC – CASCADES/QT: RECEIVE

• To receive a NFC invocation, register the application

Types which are supported by the application

Page 376: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 376

NFC – CASCADES/QT: RECEIVE

Source: https://developer.blackberry.com/cascades/documentation/

Page 377: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

377

NFC – CASCADES/QT: RECEIVE

Source: https://developer.blackberry.com/cascades/documentation/

Page 378: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 378

BLACKBERRYMESSENGER (BBM)

• Beside other communication channels, BlackBerry Messanger provides a unique way for communication

• encrypted• BBM has a lot of features

– Status updates– Video calls– Voice calls– Pin-To-Pin Messeging– Screen sharing– Text messeges– Groups

Page 379: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 379

BBM CONNECT

• It is possible to connect applications to BBM• Event driven• It is possible to access– BBM user profile– Contact list– Messaging– Application profile box

Page 380: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 380

BBM – BEST PRACTISE

• Sending invitations and messages– Make sure that users are the ones who initiate

requests to engage other users. – If users want to invite others to join games,

forums, or chats, you can allow users to enter their own text or you can provide default text

– Include a contextual link in messages that recipients receive, where possible.

Page 381: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 381

BBM – BEST PRACTISE

• Choosing contacts– Provide contacts with filter options, if possible and

if meaningful to the task. – Allow users to filter contacts by contact categories

that they created in BBM.

Page 382: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 382

BBM – BEST PRACTISE

• Chats– Make sure that users have the ability to choose the

people that they want to chat with.– When a chat begins, expose the chat interface– Make sure that you design your screens so that users

can access key features when the chat interface is open.– Make a chat interface available on multiple screens in

your application – If your application supports multiple chats, make sure

that users have a way to switch between chats.

Page 383: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 383

BBM – BEST PRACTISE

• Profile boxes– Give users the option to add information– Always ask permission before updating– If users allow your application to update their personal

message, use the personal message field to describe a quality that is attributed to the user

– Include only new events that users accomplish or specific activities that are meaningful milestones in a profile box.

– Provide a succinct description for each event in the profile box– Include a meaningful icon for the activity or event. – Create icons that are 119 x 119 pixels.

Page 384: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 384

BBM CONNECT

• Register application with BBM• Update BBM status

Page 385: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 385

BBM CONNECT

• Register application with BBM• Update BBM status

Call the C++ function to update the BBM status

Page 386: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 386

BBM CONNECT

• Register application with BBM• Update BBM status

Update the status

Page 387: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 387

LOCATION SERVICES

• Location services are very important do the users

Page 388: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 388

LOCATION SERVICES

• Location services are very important to the users– Provide location based services– Provide location based advertisment– Routing– Maps enriched applications– Combine location services with other services

Page 389: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 389

LOCATION SERVICES

• Three different parts:– Positioning: Find the location of a device using

GPS satellites, cell ID, or Wi-Fi positioning.– Geocoding: Find coordinates for a street address

(geocoding), or find a street address for geospatial coordinates (reverse geocoding).

– Mapping: Display a location in a MapView or integrate with the BlackBerry Maps application.

Page 390: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 390

LOCATION SERVICES

• Difference between– GPS Positioning– Celluar Positioning– WiFi Positioning

Page 391: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 391

LOCATION SERVICES

• Init location service

• Retrieve a single position

Page 392: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 392

LOCATION SERVICES

• Continues updates

Page 393: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 393

LOCATION SERVICES

• Continues updates

Page 394: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 394

LOCATION SERVICES

• If continuous updates are received, connect to the timeout signal

Page 395: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 395

LOCATION SERVICES

• If continuous updates are received, connect to the timeout signal

Page 396: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 396

LOCATION SERVICES

• Updates are provided every 5 seconds– Set the interval

• Are updates required in „background“

Page 397: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 397

GEOPOSITIONS

• Information from the geo position– QGeoCoordinate– Direction– GroundSpeed– VerticalSpeed– MagneticVariation– HorizontalAccuracy– Vertical Accuracy– Timestamp

Page 398: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 398

(REVERSE) GEOCODING

• Reverse geocoding is used to convert a GPS position into an address– Used to make a position human readable

• Geocoding is used to find coordinates for a given address– Used to make an address machine readable

Page 399: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 399

REVERSE GEOCODING

Page 400: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 400

REVERSE GEOCODING

Page 401: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 401

REVERSE GEOCODING

Get the service providers

Page 402: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 402

REVERSE GEOCODING

Set the coordinates for the reverse

process

Page 403: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 403

REVERSE GEOCODING

Connect to the error and finished signal

Page 404: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 404

REVERSE GEOCODING

Slots for the signals

Page 405: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 405

GEOCODING

Page 406: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 406

REVERSE GEOCODING

Page 407: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 407

REVERSE GEOCODING

Get the service providers

Page 408: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 408

REVERSE GEOCODING

Set the coordinates for the coding

process

Page 409: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 409

REVERSE GEOCODING

Connect to the error and finished signal

Page 410: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 410

REVERSE GEOCODING

Slots for the signals

Page 411: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 411

MAPS

• BlackBerry maps is installed on all BlackBerry 10 devices

• It can be used in a static or dynamic way– MapView– MapGenerator

Source: https://developer.blackberry.com/cascades/documentation/

Page 412: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 412

STATIC MAP

• Initialize the map generator

• Process the reply

Page 413: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 413

STATIC MAP

• Initialize the map generator

• Process the reply

Page 414: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 414

MAPVIEW

• Link against LIBS += -lbbcascadesmaps• A graphics user interface (GUI) control that

displays a map along with user-defined geographic elements, which can be points of interest or other location-aware elements.

• All data shown on the map is provided by the MapData object

• It still exists, if the MapView is destroyed

Page 415: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 415

MAPVIEW

Page 416: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 416

MAPVIEW

Initialize the first position

Page 417: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 417

MAPVIEW

Connect to the signal

Page 418: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 418

ADVERTISMENT SERVICE

• Provides ads from different platforms• Simple to integrate• A lot of statistics about the usage

Page 419: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 419

ADVERTISMENT SERVICE

Source: https://developer.blackberry.com/cascades/documentation/

Page 420: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 420

ADVERTISMENT SERVICE : STEPS

• Register at http://adservices.blackberry.com/register/

• LIBS += -lbbcascadesadvertisement• Set persmissions– Device Identifying – GPS Location (optional)

• Register type

Page 421: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 421

ADVERTISMENT SERVICE : STEPS

• Import in QML

• QML

Page 422: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 422

ADDTIONAL INFORMATION

Page 423: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 423

BUILD FOR BB

• Criteria– User Benefits– User Experience– Performance– Service Integration– Security– Internationalization

• Benefits– Additional area in the BlackBerry World– Additional advertisment at different events– A „thank you“ gift

• https://developer.blackberry.com/builtforblackberry/

Page 424: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 424

CASCADES ROADMAP

https://developer.blackberry.com/cascades/download/roadmap/

Page 425: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 425

VENDOR REGISTRATION

• No registration or submission fees. None. $0.00• Multiple monetization opportunities with in-app purchasing,

subscription billing, and mobile ad services• Crystal clear, transparent submission process• Increase the discoverability of your apps with a range of "Top 25"

lists that end users can search on both the mobile and desktop storefront versions of BlackBerry World

• Make it easy for end users to purchase your apps and digital goods by providing popular payment methods like PayPal, credit card, and direct to carrier billing (carrier dependent see below...)

• https://developer.blackberry.com/devzone/blackberryworld/apply_for_a_blackberry_world_membership_account.html#pde1350406051752

Source: https://developer.blackberry.com/devzone/blackberryworld/

Page 426: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 426

RELEASE CHECKLIST

• Review tips that can help smooth the approval process and get your app up on BlackBerry World faster.

• Start with our guidelines for naming your app, then go on to create great descriptions and images to help get your app noticed.

• Check that your release is ready. Make decisions about app security, digital rights, export regulations and similar details.

• If you don't already have one, apply for a membership account on the vendor portal.

• Review guidelines and criteria to give your app the best chance for a quick approval for sale on BlackBerry World.

• Submit your app, create a release, and add any digital goods you want to sell in your app.

Source: https://developer.blackberry.com/devzone/blackberryworld/

Page 427: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 427

ADDITIONAL LINKS

• Documentation– https://developer.blackberry.com/cascades/documentation/

• BlackBerry News– http://crackberry.com/

• Developer Forum– http://supportforums.blackberry.com/t5/Cascades-Development/bd-p/

Cascades• Samples

– https://github.com/blackberry/• Code Snippets

– http://cascadescode.tumblr.com/• Vendor Portal

– https://appworld.blackberry.com/isvportal/login_input.do?pageId=0

Page 428: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 428

COPYRIGHT

Page 429: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 429

EX 1

• Create a new BlackBerry Cascades Project• Read the JSON Data from – http://dienststellen.bmf.gv.at/finanzamtsliste.json

• Show the data in a list, sorted by the name• Generate a second page, which shows the

details of the selected name• If an entry in the list is triggered, open the

second page with the details for the selected name

Page 430: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 430

EX 1

• Think about useful invocations and include them (at least 1). If you define the invocation as a context action, define also an icon! (search for the bb standard icons on the web)

• Is grouping possible? What would be a good grouping argument

• Optional:– Generate a static map of the location and add it to the

details page– Load the image data included in the json asynchronously– Implement an Activity Indicator as a loading sign

Page 431: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 431

HINT

Page 432: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 432

HINT

012345678910

Page 433: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 433

HINT

012345678910

indexPath

Page 434: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 434

HINT

0

1

2

Page 435: MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRY Sommersemester 2013 Dipl.-Ing. Andre Pura Source:

[email protected] 435

PROJECT: CERTIFICATE SIGNING

• Signing documents directly an the smartphone• Used for

– Sign a document on the smartphone to use it in govermental transactions– Time logging systems– Banking application

• Signing server structural is provided• Usage using the „share“ invocation• Supported by

– BlackBerry Austria– BlackBerry Germany– mappau– Bundeskanzleramt (BKA)– Genoa