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: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: SQL is buggy in Cascades

thx Peter,

 

I also wasn't aware that in debug-mode the app/ tree is writable

 

for all others running into trouble like this I recommend to take a look at the session DEV153 (Anatomy of BB10 Projects) where I learned about read-only and read-write areas. Maybe the sessions are only available for attendees of BB10Jam - then I would recommend to attend at one of the Bb10Jam World Tour in cities worldwide.

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: SQL is buggy in Cascades


peter9477 wrote:

The quotes database for this sample is not copied to the sandbox data folder, nor to shared. It's just left in the app folder, with the code and assets.

 

With a signed install, that entire tree (under app/) is read-only. Everyone knows that... or should.

 

With a debug token install, the tree is writable. Who knew that?


That explains everything that I am seeing, (including the inconsistancy).

 

So I guess the question then is, when will RIM provide an SQL example that is actually useful? (Especially considering that this one points towards the wrong solution). Or more generally (to get at what I am really trying to do) an example of how to save a dynamicly created DataModel object. So far my attempts to save this data as a QSettings object, a QHash, a QVariant, and as a QByteArray have all failed.


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: SQL is buggy in Cascades

Ebscer, everything about that example should be usable, except for the location of the .db file. While a "starter" file can be included exactly as they do now, if it's not already found in the app sandbox (under data/) when the app launches, it should copy the file (as a raw file, not using SQL) from app/ to data/, and then all the SQL stuff should access it in the data/ folder.

Of course, as that's pretty simple, they should probably update the sample... My guess is that the guys (TAT?) who wrote it weren't aware of this issue either (app folder writable only in dev mode) and nobody pointed it out to them yet.

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: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: SQL is buggy in Cascades

it's something similar to the 'old' java ...

 

when I'm distributing a pre-loaded SQLite DB together with the APP, then at startup of the app I'm testing if the DB is there and if not I'm copying the DB to a valid location (SD Card in this case) and open.

 

so it seems to be the same now:

deploy the DB at /app tree and at first run copy it to a r/w location.

next weeks I'll also have to solve this and - if not already done - I'll do it and push to GitHub.

should be an easy to use feature.

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: SQL is buggy in Cascades

ekke: GitHub... of course!

RIM's heading towards the point they can always say "Contributions are welcome" instead of "please file an issue in Jira". Good for them. :-)

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!
Highlighted
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: SQL is buggy in Cascades


peter9477 wrote:
ekke: GitHub... of course!

RIM's heading towards the point they can always say "Contributions are welcome" instead of "please file an issue in Jira". Good for them. :-)

yes - that's the trick. So Eduardo is guilty with all his work on Open Source at RIM ;-)

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner