05-11-2012 06:18 PM
I am running the "Quotes" Cascades sample app, and it works fine in the simulator. But when I try to run it on a real device it appears as if all writes to the database fail.
Is this a known bug? or am I doing something wrong with packaging the app for release?
05-11-2012 07:09 PM
05-12-2012 03:30 PM
I have no issue with Quotes sample running on Dev Alpha.
Could you provide more detail about the issue? Such as at which part it works and when it doesn't work.
05-12-2012 06:20 PM
It appears to fail whenever I have to make a write to the database.
For example if I try to add a new quote, when I hit save the screen exits and brings me back to the app's main screen with no trace of the newly added quote to be found.
If I try to delete a quote, nothing at all happens.
If I edit a quote, the changes do take. But then once I exit and re-launch the application, then they are no longer, anywhere to be seen.
05-12-2012 06:55 PM
Hmmm... It's pretty general, did you try to debug it?
I suggest you looking at the Console to see if there is any error while running it on Dev Alpha.
Also try to manually debug using qWarning() to check if things go right. have you modified the C++ code of it? For me it works at the first time without changing any code.
05-12-2012 10:39 PM
05-12-2012 10:54 PM
05-12-2012 11:03 PM - edited 05-12-2012 11:42 PM
I have the code signed on the device. (Which could explain why the simulator acts differently).
I will try moving the database location and see if that helps at all.
Update: giving the database a different location did not seem to help. (although there is some chance I did that wrong as well).
05-12-2012 11:43 PM
Okay, wow... little known fact. In fact, so little known that I don't know if any of us "out here" know this.
When you install a devmode (debug token) install, the app/ folder contents are actually writeable by user "apps" and by the "devN" group (N is a number from 0 to 99) under which your app is installed.
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?
This probably explains a bunch of the problems certain people have had in this and other forums, where they say "It worked when I tested it, but the signed version won't work." Chances are their design is flawed, because they didn't actually know their app/ tree is supposed to be frozen and will be unwritable in the release build.
Anyway, that explains this particular thread. SQL isn't buggy... the sample is, or at least it's a dangerously simplistic sample since no real app can do it this way. (They would have to copy the quotes.db from the app folder to the data folder at first launch, and then always work there.)