Reputation: 2593
i am very confused about use of db or persistent store, if i use db then i have to store it on mmc because i have read some where that all BB devices do not allow to store db in phone memory, if i make db on mmc then user can delete it, and the second approach is Persistent Store, but it is not easy to manipulate when we have large amount of data, how can manage tons of keys to retrieve and store data in persistent store, and how can i perform delete,edit operation on persistent stored data. Do not know what to, very much confused. Which approach will be best and what will the mechanism. kindly suggest.
Upvotes: 0
Views: 358
Reputation: 180040
The BB documentation says:
If you only specify the database name as the parameter value to
DatabaseFactory.create()
, the database file is created on the SD card of the device. The default location for the database file is/SDCard/databases/<application_name>/
. The name of the application that creates the database is included in the path to avoid name collisions.You can create database files in eMMC memory, on devices that support it, by specifying the corresponding file system path.
So, to remain compatible with all devices, you have to put the database on the card.
Besides unplugging the memory card, the user can always delete and reinstall your app, so you must be prepared for your data to vanish. There is no way to force your data to be kept against the user's wishes.
The best you can do is to complain that your data is missing, and/or to reinitialize your database.
The Persistent Store indeed is not suitable for managing large amounts of data; for anything more than a simple key/data lookup, you'd have to load the data into memory and do the queries there.
Upvotes: 1
Reputation: 15047
Main difference on using peristance,is that it supports for devices below 5.0 till 7.1 for Sqlite,it supports from 5.0 Os and above,you can look for which Os you are targeting. When saving in persistance Db,you can save and retreive it as Vector,I am unware of Sqlite database.
Upvotes: 1