Data management

Many apps that you create will need to manipulate data in some way. A contacts list app might need to load existing contacts from a data file and save new contacts in the file. A sports app might track team statistics in a data file and update these statistics after each game.

The BlackBerry 10 Native SDK supports a wide range of libraries that you can use to manipulate data, like SQLite, JSON_parser, and libxml2. Cascades also provides its own set of data management APIs to help remove some of the complexity of storing and modeling data.

JSON data

When it comes to JSON data, the BlackBerry 10 Native SDK supports a couple different open source libraries you can use in addition to Cascades: JSON_parser and CouchDB. JSON_parser is a C-based parser that you can use in your apps to parse text formatted in JSON. CouchDB allows you to store and access JSON documents using HTTP and query, combine, and transform your documents with JavaScript.

SQL data

For SQL data, the SQLite library provides a serverless, transactional SQL database engine that you can include in your apps.

XML data

To parse and store XML data in your app, you can use either libxml2 or Expat. The libxml2 library is a portable XML C parsing toolkit, while Expat is a stream-oriented XML C parser.

File system access

Before you can store or retrieve data from the device, you should first make yourself familiar with the architecture of the device file system. Applications have access to their own working directories as well as a shared directory that all apps can access. For more information about the file system, see File system access.

Last modified: 2014-09-30

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus