mobile computing wahlpflichtfach blackberry sommersemester 2013 dipl.-ing. andre pura source:
TRANSCRIPT
MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura
Source: https://developer.blackberry.com/cascades/documentation/
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 ...
INTRODUCTION: BB10
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
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
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
DIFFERENCE TO OTHER PLATFORMS
• Competitors:– iOS– Android– Windows Phone– Symbian
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
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
THE „OTHERS“
• HTML– Webworks, JavaScript and HTML based
• Adobe Air– Actionscript / Flex based
• Android Emulator– Java/Android based, Android 2.3.3
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
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/
BLACKBERRY ENTERPRISE SERVERIng. Elmar Jilka, MSc
BASICS: BB10 PROGRAMMING AND GUI
COMPONENTS OF A BB10 CASCADES APPLICATION
• A Cascades Application has 3 parts:– bar-descriptor.xml– main.cpp– .qml File
DAS BAR-DESCRIPTOR.XML
• Descriptes the basics of an application – Name– ID– Versionsnumber– Author– Plattform– Icon– Splashscreen– Application Files– Permissions
MAIN.CPP
• Startpoint of each BB10 Cascades Application• It can consist of the application itself or call an
object, inherit from application
.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
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/
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/
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/
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/
23
RESOLUTIONS
?Source: https://developer.blackberry.com/cascades/documentation/
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
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/
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
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
LAYOUTS
• There are threee kinds of layouts
Stack Layout Dock Layout Absolute Layout
Source: https://developer.blackberry.com/cascades/documentation/
QML AND C++ INTEGRATION
• Load QML from C++
Source: https://developer.blackberry.com/cascades/documentation/
CHANGE QML ATTRIBUTES PROGRAMMATICALLY
• It is simple to change QML attributes from C++
QML Code
QML ATTRIBUTES
USING C++ VALUES IN QML
• Connection with a QDeclarativePropertyMap
Registrier the Mapin QML
ZUGRIFF AUF CUSTOM OBJECTS IN QML I
• It is possible to acces C++ objects from QML
Macro for Qt Signals / Slots
ZUGRIFF AUF CUSTOM OBJECTS IN QML I
• It is possible to acces C++ objects from QML
Variablename in QML
ZUGRIFF AUF CUSTOM OBJECTS IN QML I
• It is possible to acces C++ objects from QML
Called, when the variable is read
ZUGRIFF AUF CUSTOM OBJECTS IN QML I
• It is possible to acces C++ objects from QML
Called, when the variable is changed in QML
ZUGRIFF AUF CUSTOM OBJECTS IN QML I
• It is possible to acces C++ objects from QML
Signal to emit
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
ZUGRIFF AUF CUSTOM OBJECTS IN QML I
• Es kann auch ein eigenes Objekt in QML verwendet werden
Function used in QML
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
INSTALLATION OF THE IDE
44
DOWNLOAD
• SDK download: – https://developer.blackberry.com/cascades/
download
CODE SIGNING KEYS
• Order Code Signing Keys :– https://www.blackberry.com/SignedKeys/
codesigning.html• Important: Backup the keys !
SIMULATOR DOWNLOAD AND INSTALL
• Download the simulator– https://developer.blackberry.com/develop/
simulator/index.html
START IDE
IDE ACTIONS
SDK Version wählen
SDK Version nachladen
Neues Projekt, neue Klasse,
neues Sourcefile anlegen
IDE ACTIONS
SDK Version wählen
SDK Version nachladen
Neues Projekt, neue Klasse,
neues Sourcefile anlegen
Projekt kompilieren
IDE ACTIONS
SDK Version wählen
SDK Version nachladen
Neues Projekt, neue Klasse,
neues Sourcefile anlegen
Projekt kompilieren
Konfiguration ändern
IDE ACTIONS
SDK Version wählen
SDK Version nachladen
Neues Projekt, neue Klasse,
neues Sourcefile anlegen
Projekt kompilieren
Konfiguration ändern
Debugging starten
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
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
IDE - VIEWS
• Application Profiler• QML Editing• C++ Editing• Debug• System Information
SYSTEM INFORMATION - SUMMARY
SYSTEM INFORMATION – PROCESS INFO
SYSTEM INFORMATION – MEMORY INFO
SYSTEM INFORMATION – MALLOC INFO
SYSTEM INFORMATION – FILE EXPLORER
FIRST BB10 APP
FIRST APP
• Installation done?• Keys ordered?• Simulator installed?• Device in Developer Mode?– (Settings / Security and Privacy /
Developermode)
STEPS
• Create a new project• Signing Keys• Backup the Signing Keys• Connect Device• Create Debug Token• Deploy and debug the application
CREATE A NEW PROJECT
CREATE A NEW PROJECT
CREATE A NEW PROJECT
SIGNING KEYS AND CERTIFICATE
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
START DEBUGGING
START DEBUGGING
START DEBUGGING
START DEBUGGING
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
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
MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura
BLACKBERRY 10CONCEPTS
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/
USE C++ CLASSES IN QML
• The object must be registered and can be used in QML directly
extends
HOW CAN WE ACCESS C++ FROM QML ?
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
HOW CAN WE ACCESS QML FROM C++ ?
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
APPLICATION LIFETIME
APPLICATION LIFETIME
Source: https://developer.blackberry.com/cascades/documentation/
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
APPLICATION LIFETIME
• Each application has 3 different states:– Fullscreen– Thumbnail– Invisible
Source: https://developer.blackberry.com/cascades/documentation/
APPLICATION LIFETIME
• Each application has 3 different states:– Fullscreen– Thumbnail– Invisible
Source: https://developer.blackberry.com/cascades/documentation/
APPLICATION LIFETIME
• Each application has 3 different states:– Fullscreen– Thumbnail– Invisible
Source: https://developer.blackberry.com/cascades/documentation/
CASCADES ❤ JAVASCRIPT
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
JAVASCRIPT IN CASCADES
JAVASCRIPT IN CASCADES - FUNKTION
CONNECT A SIGNAL TO A JAVASCRIPT FUNCTION
GUI ELEMENTS
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
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
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
GUI ELEMENTS- CONTAINER
• Signals:– onControlAdded– onControlReplaced– onControlRemoved– onControlMoved– onLayoutChanged– onBackgroundChanged– onClipContentToBoundsChanged
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/
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/
GUI ELEMENTS- BUTTON
• Important signal– onClicked (extended by AbstractButton)
• Properties– imageSource– image– text
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/
GUI ELEMENTS- TEXTFIELD
• Important Properties– hintText– inputMode– validator– Input (Mit TextInputProperties)
• submitKey• flags (Spellcheck, PredictionOff)
• Important signals– onTextChanging– onValidatorChanged
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
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/
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
GUI ELEMENTS– IMAGEVIEW
• The ImageView is used to display images• A ScrollView is used for pitch-to-zoom• Important properties– scalingMethod– imageSource
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
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
GUI ELEMENTS– WEBVIEW
• JavaScript, which is embedded in a WebView, can react with onmessage() and postMessage
GUI ELEMENTS– WEBVIEW
• JavaScript, which is embedded in a WebView, can react with onmessage() and postMessage
WHY IS IT IMPORTANT TO COMMUNICATE WITH EMBEDDED JAVASCRIPT?
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
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/
GUI ELEMENTS– ACTIVITY INDICATOR
Initalize the ActivityIndicator
Start the ActivityIndicator
Stop the ActivityIndicator
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/
GUI ELEMENTS– ACTIONITEM - CONTEXTACTION
Source: https://developer.blackberry.com/cascades/documentation/
GUI ELEMENTS– ACTIONITEM - CONTEXTACTION
GUI ELEMENTS– ACTIONITEM - CONTEXTACTION
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/
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/
APPLICATIONMENU
Source: https://developer.blackberry.com/cascades/documentation/
APPLICATIONMENU
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/
156
ORIENTATION HANDLING
• Define the usage of both orientations in the manifest
Source: https://developer.blackberry.com/cascades/documentation/
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
ORIENTATION HANDLING
• onOrientationAboutToChange in the handler is used to react on changes
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/
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
ADD GUI ELEMENTS PROGRAMMATICALLY
BEISPIEL DER GUI ELEMENTE
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
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
HINT
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
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“)
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.
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
MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura
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
RECAPITULATION
• 2 types of applications– Drill-Down– Tabs
• Important GUI Elements– Container– Label– ImageView– Button– TextField
RECAPITULATION
• Menus– Context Menu– Page Context Menu– Application Menu
• ActionItem
RECAPITULATION
• Communication between QML and C++– Generate Object in C++ and pass it to QML– PropertyMap– Import C++ Class in QML and generate objects
INVOCATION FRAMEWORK
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
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
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.
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)
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/
INVOCATION FRAMEWORK – BOUND INVOCATION
Quelle: http://devblog.blackberry.com/2012/11/bbm-invocation-framework/
INVOCATION FRAMEWORK – UNBOUND INVOCATION
Quelle: http://supportforums.blackberry.com/t5/Cascades-Development/Open-browser-from-app/td-p/1952547
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
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
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
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)
INVOCATION FRAMEWORK – RECEIVING INVOCATIONS
• In addition, some lines of C++ code is required• The application have to known in which state
it was started
Connect to the InvocationManager
React on the kind of start
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
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)
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=*;
EXAMPLES TARGET FILTER
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
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
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
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
CARDS
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
CARDS - KINDS
• There are three kinds of cards:
Picker Composer Previewer
Source: https://developer.blackberry.com/cascades/documentation/
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.
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/
CARDS – TRANSITION - PREVIEWER
Source: https://developer.blackberry.com/cascades/documentation/
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/
CARDS - DESIGN
• BlackBerry defines in the GUI Guidelines some rules
• Cards must support both orientations
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
CARDS - STARTMODE
• If an application is started, it must be identified, if the application was called by another application as a card or not
Connect to „invoked“ signal
Is the application called as a card?
CARDS – SEND A RESPONSE
• If the card is closed, you can/must provide dan response
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
Connect to resize signal
Function, which is called on an emitted signal
EXAMPLES OF INVOCATIONS
MENU INTEGRATION
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
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
ACTIVE FRAME
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/
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/
ACTIVE FRAME – STYLE GUIDELINES
Source: https://developer.blackberry.com/cascades/documentation/
ACTIVE FRAME – STYLE GUIDELINES
Source: https://developer.blackberry.com/cascades/documentation/
ACTIVE FRAME - STATIC
• Register the components to use them in QML
• Generate the Cover for the active frame in QML
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)
ACTIVE FRAME - DYNAMIC
ACTIVE FRAME - DYNAMIC
ACTIVE FRAME - DYNAMIC
Trigger the update every 2 hours
Call the first update, when the appication
is thumbnailed
ACTIVE FRAME – DYNAMIC- SET
EXAMPLES OF ACTIVE FRAMES
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)
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“
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.
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
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
MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura
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
RECAPITULATION
• 2 types of applications– Drill-Down– Tabs
• Important GUI Elements– Container– Label– ImageView– Button– TextField
RECAPITULATION
• Menus– Context Menu– Page Context Menu– Application Menu
• ActionItem
RECAPITULATION
• Communication between QML and C++– Generate Object in C++ and pass it to QML– PropertyMap– Import C++ Class in QML and generate objects
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
DATA STORAGE
CASCADES ACCES DATA
• Cascades has an advanced system access data• This system has different elements
CASCADES ACCES DATA- ELEMENTE
Adapter to connect the GUI to acces data from QML simple and
fast
CASCADES ACCES DATA- ELEMENTE
Sorts and organizes the data to show it in the best way
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
FILE SYSTEM - STRUCTUR
Source: https://developer.blackberry.com/cascades/documentation/
FILE SYSTEM - STRUCTUR
Application root (r)1
1 r = read w = write s = symbolic
FILE SYSTEM - STRUCTUR
Installation directory (r)
1 r = read w = write s = symbolic
FILE SYSTEM - STRUCTURBinary Files and other application ressources
(r)
1 r = read w = write s = symbolic
FILE SYSTEM - STRUCTUR
Images, media files and qml documents (r)
1 r = read w = write s = symbolic
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
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
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
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
FILESYSTEM – WORKING DIRECTORY
• Different names– Application Root– Current Directory– Sandbox
• Access data using relative or absolute path– ./data– /accounts/1000/appdata/
namespace.application/data
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
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“
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
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
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
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
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)
JSON - CODE
JSON - QML
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)
XML DATA- CODE
READ XML IN QML
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)
SQL READ
SQL WRITE
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
DATASOURCE QML – EXTERNAL XML
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
GROUPEDATAMODEL
• It is possible to group elments
Source: https://developer.blackberry.com/cascades/documentation/
GROUPEDATAMODEL - QML
STANDARDLISTITEM
• A StandardListItem can have the following attributes– Image– ImageSource– Title– Status– Description
Source: https://developer.blackberry.com/cascades/documentation/
STANDARDLISTITEM
• A StandardListItem can have the following attributes– Image– ImageSource– Title– Status– Description
Source: https://developer.blackberry.com/cascades/documentation/
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
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
EXAMPLE: HOW TO READ A RSS FEED?
EXAMPLE: HOW TO READ A RSS FEED?
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
EXAMPLE: HOW TO READ A RSS FEED?
EXAMPLE: HOW TO READ A RSS FEED?
If there is existing data, delete it and add the new
data
EXAMPLE: HOW TO READ A RSS FEED?
EXAMPLE: HOW TO READ A RSS FEED?
Connect the list with the DataModel
How a ListItem looks like
COMMUNICATION
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/
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
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/
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
PUSH - MANIFEST
• Permessions to receive push messages
• Using the invocation framework, the application is startet with the pushed data
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
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
PUSH - CODE
• If BB10 receives a push notification, it passes it to the registered application
• The application decides what happens with the message
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
PUSH - CODE
• If the user clicks on a notification in the BlackBerry Hub the application is invoked using BB_OPEN_INVOCATION_ACTION
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
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/
SET A NOTIFICATION PROGRAMMATICALLY
• It is easy so set an notification programmatically
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
DELETE A NOTIFICATION
• You should delete the notification from the hub, if it was consumed
• Single notification
• All notifications
NOTIFICATION - QML
• Notifications can be initializied using WML• Configure it:
• And deliver it to the hub
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
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
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
MOBILE COMPUTING WAHLPFLICHTFACH BLACKBERRYSommersemester 2013Dipl.-Ing. Andre Pura
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
RECAPITULATION
• 2 types of applications– Drill-Down– Tabs
• Important GUI Elements– Container– Label– ImageView– Button– TextField
RECAPITULATION
• Menus– Context Menu– Page Context Menu– Application Menu
• ActionItem
RECAPITULATION
• Communication between QML and C++– Generate Object in C++ and pass it to QML– PropertyMap– Import C++ Class in QML and generate objects
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
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
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
COMMUNICATION
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
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/
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/
NFC – INVOCATION FRAMEWORK: FILE
Source: https://developer.blackberry.com/cascades/documentation/
NFC – INVOCATION FRAMEWORK: DATA
NFC – INVOCATION FRAMEWORK: SQUENCEDIAGRAM
Source: https://developer.blackberry.com/cascades/documentation/
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
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"/>
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
NFC – INVOCATION FRAMEWORK EXAMPLE DATA
NFC – INVOCATION FRAMEWORK EXAMPLE DATA
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
NFC – INVOCATION FRAMEWORK EXAMPLE FILE
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
NFC – CASCADES/QT: DATA
Source: https://developer.blackberry.com/cascades/documentation/
NFC – CASCADES/QT: FILE
Source: https://developer.blackberry.com/cascades/documentation/
NFC – CASCADES/QT: SEND
• It is possible to share data and files– NfcShareDataContent– NfcShareFilesContent
NFC – CASCADES/QT: SEND
• It is possible to share data and files– NfcShareDataContent– NfcShareFilesContent
NFC – CASCADES/QT: SEND
• Data is passed to NfcShareManager• Data is valid until– Is was used– the ShareMode is set to disabled
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
NFC – CASCADES/QT: SEND
NFC – CASCADES/QT: SEND
In difference to sending data, uri is passed here.
Bluetooth will be activated and the data is sent using it
NFC – CASCADES/QT: RECEIVE
• To receive a NFC invocation, register the application
NFC – CASCADES/QT: RECEIVE
• To receive a NFC invocation, register the application
Types which are supported by the application
NFC – CASCADES/QT: RECEIVE
Source: https://developer.blackberry.com/cascades/documentation/
377
NFC – CASCADES/QT: RECEIVE
Source: https://developer.blackberry.com/cascades/documentation/
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
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
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.
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.
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.
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.
BBM CONNECT
• Register application with BBM• Update BBM status
Call the C++ function to update the BBM status
BBM CONNECT
• Register application with BBM• Update BBM status
Update the status
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
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.
LOCATION SERVICES
• Difference between– GPS Positioning– Celluar Positioning– WiFi Positioning
LOCATION SERVICES
• If continuous updates are received, connect to the timeout signal
LOCATION SERVICES
• If continuous updates are received, connect to the timeout signal
LOCATION SERVICES
• Updates are provided every 5 seconds– Set the interval
• Are updates required in „background“
GEOPOSITIONS
• Information from the geo position– QGeoCoordinate– Direction– GroundSpeed– VerticalSpeed– MagneticVariation– HorizontalAccuracy– Vertical Accuracy– Timestamp
(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
REVERSE GEOCODING
REVERSE GEOCODING
GEOCODING
REVERSE GEOCODING
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/
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
MAPVIEW
ADVERTISMENT SERVICE
• Provides ads from different platforms• Simple to integrate• A lot of statistics about the usage
ADVERTISMENT SERVICE
Source: https://developer.blackberry.com/cascades/documentation/
ADVERTISMENT SERVICE : STEPS
• Register at http://adservices.blackberry.com/register/
• LIBS += -lbbcascadesadvertisement• Set persmissions– Device Identifying – GPS Location (optional)
• Register type
ADDTIONAL INFORMATION
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/
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/
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/
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
COPYRIGHT
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
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
HINT
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