It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

BlackBerry Platform Services Library

The BlackBerry Platform Services (BPS) library provides C/C++ developers with a single consistent interface to a number of different platform services:

Audio devices

Audio mixer

Battery

Buttons

Cellular network status

Clock

Device information

Dialogs

Events

Geofencing

Geolocation

Holster

Invocation

LED

Locale

Media controllers

Media player

Menus

Multimedia renderer

Navigator

Network status

Notifications

Orientation

Payment services

Region

Removable media

Screen

Screen capture

Screen input guard

Sensors

Sound player

Vibration

Virtual keyboard

BPS provides a functional interface to platform services, along with an event-retrieval mechanism for asynchronous notification.

Requesting and Listening for Events

The BPS library provides a high-level view of various platform services. Each client application simply makes one request to the platform services that it wants to receive events for. A loop is set up to listen for the events and the client application determines how to handle the event using custom application logic.

Events are then generated and processed, and the application can interact with the platform service as necessary.

Events

Different platform services generate different events. Events are differentiated by the event domain (the service that generated the event) and the event code (the type of the event). In addition, events can have a payload that includes any information sent along from the service when it generated the event.

You can use the bps_event_get_domain() function to determine the service (event domain) that generated a particular event. The event code can be determined with the bps_event_get_code() function. Normally, an event handler uses the event domain and event code to determine what the event is. Once the event is known, it can be handled properly. For example, individual accessor functions can be used to extract the payload data appropriate to the event.

BlackBerry Platform Services Channels

The BlackBerry Platform Services (BPS) uses channels to receive platform service events. Each BPS channel has an event queue associated with it. BPS restricts ownership of a channel to the thread that created the channel because access to the event queue is not thread-safe. This differs from channels created directly in QNX Neutrino, where a channel is owned by a process and therefore, channels can be accessed by any thread owned by the process.

When you use the bps_initialize() function, a default channel is created that is set as active. You can use the bps_channel_create() function to create a new channel on behalf of the application. The new channel can receive events once it is active. Active channels are used when you want to work with events and file descriptors in your application. You use the bps_channel_set_active() to set a channel as active and bps_channel_destroy() to destroy a channel you created using the bps_channel_create() function.

1. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

2. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades radio buttons to display the samples relevant to you.

3. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

You can access all the documentation that you need in the left-hand navigation.

4. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.