views:

283

answers:

1

We have an application we would like to port to the BlackBerry platform that reads its data from a SQLite database that, for the purposes of this port, will be around 4 MB. This database isn't particularly complicated (few relationships, two interesting tables to index/search and the resultant data) and is only used for reading.

What's the best way to reproduce such a thing on the BlackBerry without a database?

A couple of notes:

  • We'd love to use a database on the BlackBerry but, since this application is freeware, we can only consider freeware solutions (such as SQLite). We cannot push these costs to our consumers.
  • We are aware that 5.0 supports SQLite but we'll want to support older devices (i.e. OS 4.2).
  • This application cannot rely on a connection to the internet.

It looks like the following options are possibilities:

  • RMS (Record Management System) - Appears to be a possibility but we haven't been able to find a good API to write these files outside of the device. For example, we'd like to prepare the database using a Java or .NET program (much like we do SQLite) and simply transfer the resultant data files to the device. We won't be writing the records from a BlackBerry application.

  • BlackBerry Persistence Store - Appears to be a nicer version of RMS with the same major drawback.

  • File Connection API - This appears to our best choice, even though we have to do all the heavy lifting. I haven't had the chance to do the research but I'm hoping there are some APIs for writing database like formats (e.g. something akin to JSON) to flat files for applications such as the one we propose. Any help here would be appreciated.

+4  A: 

To use persistent store or file for db storage? It depends on several things:

  • data amount (if it's > 1 mb, better use filesystem and several files)
  • security (if you need encryption, use persistent store)
  • performance (persistent store will slowdown memory performance, but filesystem io will hit processor performance no metter how large file size is)
  • framework limitation (ex. you can't open xml file > about 1.7 mb using kXML)

See also:

Blackberry - application settings save/load
J2ME/Blackberry - how to read/write text file?
Better approach for XML Creation in Blackberry

Max Gontar