Log in / Register
Home arrow Computer Science arrow Learn BlackBerry 10 App Development
< Prev   CONTENTS   Next >

Getting Started

This chapter will show you how to set up your BlackBerry 10 development environment and deploy your first application on the BlackBerry 10 simulator and on a physical device. You will also get a broad perspective of the Cascades programming model, as well as its most essential features. In setting up your environment, I will walk you through the following steps:

n Getting your code signing keys and generating debug tokens.

n Using the Momentics IDE to create your first Cascades project.

n Building and deploying your application on a simulator and a physical device.

Cascades Programming Model

BlackBerry 10 is a major mobile operating system overhaul. It's the third release built on top of the extremely reliable QNX operating system, which is used in critical applications ranging from medical devices to nuclear power plants. QNX is also POSIX compliant, meaning that if you're familiar with a UNIX programming API, you will feel just at home with the operating system's calls. Another big

advantage of building BlackBerry 10 on top of a POSIX system is the availability of a myriad of opensource libraries that you can include in your own projects.

A key feature of BlackBerry 10 is that it is built using a multilayered architecture where QNX is the backbone providing essential services such as multithreading, memory management, and security, to name a few (see Figure 1-1). The layer on top of QNX includes the BlackBerry Platform Services (BPS) as well as several modules from the Qt framework.

Figure 1-1. BlackBerry 10 platform

BPS is an API written in C, giving low-level access to the BlackBerry 10 device. It's mostly used when you need to write high-performance applications such as games that require the most effective way of accessing the hardware. BPS is not the main subject of this book. I will nevertheless give you examples of how to use it, but I will mostly concentrate on the higher-level modules built on top of BPS.

Qt is a C++ framework providing an abstraction layer to the lower-level POSIX APIs. It also adds many classes and components essential to C++ programming. The following modules from the Qt framework have been ported to the BlackBerry 10 platform and can be used in your own applications:

n QtCore: Provides the core framework elements for building C++ applications.

In particular, QtCore defines the Qt object system, an event handling mechanism called signals and slots, memory management, and collection classes, to name a few.

n QtNetwork: Provides APIs for building networked applications. In particular, for HTTP applications, it provides the QNetworkAccessManager class.

n QtSql: Includes drivers and data access logic to relational databases.

n QtXml: Includes SAX and DOM parsers for handling XML documents.

The Qt modules mostly provide non-GUI functionality for your application. To build rich native applications with an engaging UI, you need to rely on the Cascades layer of the BlackBerry 10 architecture. In fact, Cascades is much more than a GUI framework; it also includes the following nonexhaustive list of services and APIs:

n User interface: Provides the core components for building rich native user interfaces using QML/JavaScript, C++, or a mix of all three technologies.

n Application integration: APIs that integrate platform applications and functionality such as e-mail and calendar into your own apps.

n Data management: High-level APIs abstracting data sources and data models. The supported data formats include SQL, XML, and JSON.

n Communication: APIs for enabling your apps to communicate with other devices by using, for example, Bluetooth, Wi-Fi, and NFC.

n Location: APIs for using maps and managing location services in your application.

n Multimedia: APIs for accessing the camera, audio player, and video player in your apps.

n Platform: Additional APIs for managing platform notifications and home screen functions.

When developing native applications, you will notice that there is some overlap between the functionality provided by Cascades and the underlying modules. At first this might seem confusing but you should keep in mind that Cascades often provides a richer and easier-to-use API. Therefore, as a good rule of thumb, always try to implement a functionality with the Cascades API first, and if

it is not possible, use the underlying Qt or BPS modules. Networking is a good example where you will use the QtNetwork module essentially.

Found a mistake? Please highlight the word and press Shift + Enter  
< Prev   CONTENTS   Next >
Business & Finance
Computer Science
Language & Literature
Political science