Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Robdob
Posts: 223
Registered: ‎01-31-2013
Accepted Solution

SQL Lite: Unable to write to readonly database error on release to appworld sandbox

[ Edited ]

Hi,

 

everything was workin find in development mode, however when I downloaded and ran my app from the appworld sandbox I get the following error:

 

SQLLite:

 

"Unable to write to readonly database error"

 

thanks in advance...



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
peter9477
Posts: 6,448
Registered: ‎12-08-2010
My Carrier: none

Re: SQL Lite: Unable to write to readonly database error on release to appworld sandbox

Is this a database that's in your app/ folder (i.e. came from your .bar file automatically during installation)?

You must not write to the app/ folder in your app. That can be done in development mode but it's intended only as a convenience for certain types of debug deployment (so you don't have to copy all the files over each time you make a change).

If you have data included in your app, which must be modified after installation, it must be copied to the app's ./data folder when the app first runs (or, at least, when it first needs to modify it).

Background here: https://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.d...

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
Robdob
Posts: 223
Registered: ‎01-31-2013

Re: SQL Lite: Unable to write to readonly database error on release to appworld sandbox

[ Edited ]

Yes this is exactly my situation.  and the app also needs to read/write this database. So then what I must do is copy my empty database from the asets folder to the /data forlder and then open it from there provided it doesn't already exist..

 

thank you..



GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
Please use plain text.
Developer
peter9477
Posts: 6,448
Registered: ‎12-08-2010
My Carrier: none

Re: SQL Lite: Unable to write to readonly database error on release to appworld sandbox

Yes, it has to be handled in your app, programmatically, as you describe because there's no way to request automatic unpacking files in the .bar into the data/ folder.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.