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

Notebooks are used to organize actionable and non-actionable items called notebook entries into separate folders or topics. For example, you can create a "grocery list" notebook that contains items you need to purchase, each of which can be marked as completed as it is added to your cart. Notebooks can also contain non-actionable notebook entries, such as photos taken on a trip. Notebook entries are represented by the NotebookEntry class.

Some notebooks are created automatically by the system and have special meaning and behavior. Such special notebooks can be recognized by querying their Notebook::type() function, which will return something other than Notebook::Generic. Items in a non-generic notebook are generally kept in sync with another source, such as an ActiveSync account. See the Notebook::Type enum for supported special notebook types.

Example usage:

// Here's how to create a Notebook with a name and custom attribute, and add
// it to the default Notebook account database using the NotebookService.
// Note that service objects are potentially expensive to initialize, so you
// should not create them on a per-use basis as is done below.
AccountKey defaultAccountKey = AccountService().defaultAccount(
Service::Notebook ).id();
Notebook notebook;
notebook.setName( "New Notebook" );
notebook.setAttribute( "my_attribute", "my_attribute_value" );
// You should be sure to check the return code from addNotebook() for
// success
NotebookService().addNotebook( &notebook, defaultAccountKey );

~Notebook()

boolallowAddNotebookEntry()

Notebook entries cannot be added or moved to some system-created notebooks. Any attempt to add or move an entry to these notebooks via NotebookService::addNotebookEntry() will be rejected with an error code of NotebookServiceResult::ParentNotebookNotAllowed. You should query this function before attempting to add or move a notebook entry to a notebook, and UIs should query this function to determine whether to present an add or move operation to the user.

Return:

true if NotebookEntry objects can be added or moved to this Notebook, false otherwise.

boolhasConstraint (

Some system-created notebooks have constraints on their properties. These are soft constraints, meaning that invocations of NotebookService::updateNotebook() will not fail if the constraints are violated. Instead, those portions of the update that violate a constraint will be ignored.

For example, consider a Notebook whose name is not editable. If an update is done on that Notebook where its name is changed and an attribute is added, then the new attribute will be persisted but the new name will not.

You can use this function to determine how to present an edit UI to the user. For example, given a Notebook whose name is not editable, the edit UI should prevent the user from editing the name instead of letting NotebookService silently enforce that constraint.

boolhasNotebookEntryConstraint (

Indicates whether this Notebook imposes the provided constraint on its notebook entries.

Some system-created notebooks impose constraints the properties of their contained NotebookEntry objects. These are soft constraints, meaning that invocations of NotebookService::addNotebookEntry() and NotebookService::updateNotebookEntry() will not fail if the constraints are violated. Instead, those portions of the add or update operations that violate a constraint will be ignored or made to agree with the violated constraint.

For example, consider a Notebook that imposes the constraint that the statuses of its NotebookEntry objects must be "not actionable". If a NotebookEntry with an actionable status (that is, "not completed" or "completed") is added to this type of Notebook, then its status will be persisted as "not actionable".

You can use this function to determine how to present an add or edit UI to the user. For example, given a NotebookEntry that does not support attachments, the add or edit UI should prevent the user from manipulating attachments instead of letting NotebookService silently enforce that constraint.

Parameters

constraint

The notebook entry constraint being checked.

Return:

true if this Notebook has the provided constraint on its notebook entries, false otherwise.

The ID uniquely identifies a Notebook in a particular account. The ID is assigned automatically by the database when a Notebook is added using the NotebookService. You can't set the ID of a Notebook manually.

Return:

The ID of this Notebook.

Since:

BlackBerry 10.0.0

boolisDeletable()

Some system-created notebooks do not allow themselves to be deleted. Any attempt to delete this type of Notebook using NotebookService::deleteNotebook() will be rejected with an error code of NotebookServiceResult::OperationNotAllowed. You should query this function before attempting to delete a Notebook, and UIs should query this function to determine whether to present a delete operation to the user.

Note that unlike Notebook::isReadOnly(), this constraint does not affect the NotebookEntry objects that this Notebook contains. Thus, a Notebook that is not deletable may still have its NotebookEntry objects deleted (as long as the Notebook is not also read-only).

Return:

true if this Notebook is deletable, false otherwise.

Since:

BlackBerry 10.0.0

boolisReadOnly()

Some system-created notebooks do not allow their contents (including their notebook entries) to be changed in any way. Any attempt to update this type of Notebook or its NotebookEntry objects by using NotebookService will result in that operation being rejected with an appropriate error code (see the individual NotebookService functions for details on which error code is returned). You should query this function to determine whether an operation is supported before attempting to invoke that operation, and UIs should query this function to determine whether to present such operations to the user.

A read-only Notebook does not allow the following operations to take place:

boolisValid()

A default-constructed Notebook is considered invalid until at least one of its values is set. You should use this function to determine if a Notebook is valid before you use it. For example, if you call NotebookService::notebook() to retrieve a Notebook but you provide a non-existent ID, the Notebook object that is returned will be invalid.

booloperator!= (

This operator indicates whether the provided Notebook contains a different name or different attributes than this Notebook. The purpose of this operator is to compare only the user-editable contents of the two Notebook objects; other fields, such as ID and type, are not considered.

To determine whether two Notebook objects represent different notebooks in the database, you should do an inequality comparison on the IDs of the two Notebook objects, rather than on the Notebook objects themselves.

Parameters

other

The Notebook to compare to this one for inequality of name or attributes.

Return:

true if the provided Notebook has a different name or different attributes than this Notebook, false otherwise.

booloperator== (

This operator indicates whether the provided Notebook contains the same name and attributes as this Notebook. The purpose of this operator is to compare only the user-editable contents of the two Notebook objects; other fields, such as ID and type, are not considered.

To determine whether two Notebook objects represent the same notebook in the database, you should do an equality comparison on the IDs of the two Notebook objects, rather than on the Notebook objects themselves.

Parameters

other

The Notebook to compare to this one for equality of name and attributes.

Return:

true if the provided Notebook has the same name and attributes as this Notebook, false otherwise.

1. Choose your focus

This is the focus controller. Use this controller to choose your primary development approach (Cascades or Core).

By selecting a focus, you get to decide what content should be front and center on the site.

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

3. 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 check boxes to display the samples relevant to your focus.

4. Educate yourself

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

The documentation for your preferred focus always appears at the top of the left-hand navigation, but you can still access the rest of the documentation at the bottom.

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