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.×

Open a connection to the BlackBerry Hub

You can use uds_init()
to initialize the UDS library and open a
connection to the BlackBerry Hub so that your app can start adding and manipulating data. This
function must be the first UDS function that your app calls.

To use synchronous mode, your app calls this function with the
async parameter set to false. To use asynchronous mode, your app calls this function with the
async parameter set to true. Check the return value to verify the success of the
initialization call.

The primary handle that's used to communicate with the BlackBerry Hub
is uds_context_t. You need to pass this handle to
many functions that interact with the BlackBerry Hub. If you see a UDS_ERROR_TIMEOUT status, you
need to reinitialize by calling uds_init()
again.

Register your app with the BlackBerry Hub

You can use uds_register_client()
to register your app
with the BlackBerry Hub. When your app registers using this function, you need to
provide a service URL to identify your app, a library path that specifies any
modules that must be loaded by the BlackBerry Hub, and a relative path to any assets that your data uses, such as images or icons.
This function returns a unique service ID to identify your app, as well as the
status of the registration.

The service URL is unique to your app. If the service URL that
you use is the same as another one that is already registered, you will get errors.
You can't use the service URL that is in the sample code.

You need to determine the perimeter type and then determine the absolute path to the
BlackBerry Hub assets. The path to your app's assets is dependent on which
perimeter is being used and you need to provide different assets for each perimeter.

If your app hasn't registered with the BlackBerry Hub
before or the BlackBerry Hub has been cleared because the device was restarted after an
update, the status that's received is UDS_REGISTRATION_NEW. In this case, your app must send all of its
information (such as account information, inbox list item information, and so on) to
the BlackBerry Hub for population. If your app has previously registered with
the BlackBerry Hub, the status that's received is UDS_REGISTRATION_EXISTS. In this case, you can choose to send only the
information that is new since your app last synchronized with the BlackBerry Hub, instead of sending all of the information. If you see a UDS_ERROR_TIMEOUT status, you need to reinitialize by calling uds_register_client() again.

Retrieve the service ID and service status

You can use uds_get_service_id()
to retrieve the
service ID that's assigned to identify your app to the BlackBerry Hub. In synchronous mode, you should call this function only after you call uds_register_client() and receive UDS_SUCCESS from that function. In asynchronous mode,
you should call this function only after you call uds_register_client() and receive a return value of true from uds_get_response()
. This function call is
optional.

You can use uds_get_service_status()
to retrieve the
service status after you register your app with the BlackBerry Hub. In synchronous mode, you should call this function only after you call uds_register_client() and receive UDS_SUCCESS from that function. In asynchronous mode,
you should call this function only after you call uds_register_client() and receive a return value of true from uds_get_response(). This function call is optional.

Add an account

Your app can add unique accounts that are associated with its
features or services. You can use uds_account_added()
to add an account to
the BlackBerry Hub. Typically, your app creates one account to represent its
data in the BlackBerry Hub. Each account is represented in the main view of the BlackBerry Hub
by a unique tab and icon (which you set using uds_account_data_set_icon()
). Users can
select the tab to view your data.

Account actions apply to the account as a whole, and they appear on
the action bar (or in the overflow menu) when users view the tab for your account.
Inbox item actions appear in the context menu when users press and hold an inbox
list item in your account.

Add an inbox list item

You can use uds_item_added()
to add an inbox list item to a specific
account in the BlackBerry Hub. Before adding an inbox list item, you need to determine the
perimeter type.

Like the service URL, the BlackBerry Hub
app item MIME types are unique. If you reuse a MIME type that is used by another
app, BlackBerry Hub item invocations can stop working or invoke the wrong app or
service when trying to view an item or perform a BlackBerry Hub
action on an item.

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.