user913436
user913436

Reputation: 33

Creating a database in the blackberry device when the app is installed

I want to create a database on my blackberry device when my app is installed. I did not find any event (e.g. onInstalled) so that i can create my databse on this event when the app is installed. Apparently there is a method DatabaseFactory.exists() which i can use to check if the database exists or not. But i do not want to check for this every time. I want to create the database when my app is installed and when the app is un-installed then the database should also get deleted. Thanks

Upvotes: 1

Views: 355

Answers (2)

user784540
user784540

Reputation:

As far as I know RIM API SDK does not provide mechanism to catch install/uninstall events. And even the database is once created it can be deleted/damaged via the filesystem. For instance user deletes database files from the media-card or from the device memory. Just because user does not know what these files contain and assumes these as temporary or something else.

It is a good approach to check the database presence before starting work with it. Otherwise user may get blank white screen with text "Exception 1234" and some additional text, or may get a popup with strange message, like "Error: FileNotFoundException...".

Upvotes: 3

alishaik786
alishaik786

Reputation: 3726

See the SQLiteDemo in the blackberry samples demo then you can get solution.

Upvotes: -1

Related Questions