Persistent Data Storage in Smartphone Apps Part 1
Posted by Steven Preston in BlackBerry, How-to
Recently I’ve had to write a few apps that have required intensive access to a large store of data. The first implementation that comes to mind is to deploy a central database and retrieve the necessary data through web services. In this case, only one set of data is required to be maintained and so consistency across apps and platforms isn’t an issue. However, in certain instances it has been undesirable to rely on the phones data connection at all times; and so the only option left is to store the full set of data on the handset.
SQLite is by far the most attractive solution to our needs: “SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine.”. It is lightweight, reads and writes to ordinary files, is compact and cross-platform. It is really ideal to implement within a mobile app; and can be implemented in Android, iPhone and Windows Mobile apps, Symbian S60 phones running 9.4 and later, and BlackBerry’s running the BlackBerry Device Software version 5.0. Although this list is comprehensive it isn’t by any means all-encompassing.
The majority of BlackBerry devices in use are pre-version 5.0, which leaves us searching for another solution. The two possibilities are the Ultralite implementation of SQL Anywhere from Sybase (Windows Mobile, Palm OS, Symbian OS and Blackberry 4.1+ support); and BlackBerry’s persistent store APIs, which makes it possible to save objects across device resets. In part 2 we’ll take a look at these two possibilities.
If you know of any other means of storing persistent data within mobile apps, let me know!


