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
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier
Accepted Solution

Write access to assets folder

I have SQLite DB in /assets folder. When I deploy I just open connection to the assets folder. 

 

In the docs it says assets folder is a read only folder and app should copy files which need to be writeable into application data directory from the assets folder.

 

However on both simulator and dev alpha I simply open connection to db file in assets folder and are able read/update data in the db file and the changes are persisted between application restarts.

 

Will this behaviour change on an actual release or am I missing something?

---
If you find my post helpful please "like" it and "accept as a solution"
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Write access to assets folder

What you're seeing is only a convenience for certain types of use during development. Signed apps have NO write access anywhere inside their "app" folder, which includes the assets folder. You *must* copy to data/ at first launch if you want to make changes to those files. Alternatively, implement a "copy on write" mechanism so only files which are actually changed ever get copied, though obviously that's more complicated.

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!
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Write access to assets folder

See also http://developer.blackberry.com/native/documentation/bb10/com.qnx.doc.native_sdk.devguide/com.qnx.do...

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!
Developer
Posts: 181
Registered: ‎07-19-2012
My Device: Q5, Q10, Z10, Z30, PlayBook
My Carrier: Carrier

Re: Write access to assets folder

Makes sense. Thank you Peter!

---
If you find my post helpful please "like" it and "accept as a solution"