I work with Sqlite in my app, I try UPDATE data, when I probe in simulator all is fine, but when I try this in dispositive, I receive error 8, the Data Base is ready only.
In windows, for android all is ok. The app in device not problem. The problem is in IOS.
system.ResourcesDirectory is read-only… you can’t write to files in that directory. You’ll need to make sure the database is in system.DocumentsDirectory.
I’m not sure how well you’re going to like this answer.
You cannot pre-build an SQLite database in system.DocumentsDirectory. You might be able to get it to work in the simulator because the system.DocumentsDirectory folder is accessible from a Mac or from Windows. However, the app you deploy to iOS or Android is a read-only bundle of compiled and crytpologically signed code and data. You cannot change this in anyway. When the app installs, the OS creates a writable sandbox folder that Corona SDK accesses as system.DocumentsDirectory. This folder will be empty.
It’s your responsibility to include your SQLlite database in your system.ResourcesDirectory (i.e. the folder with main.lua) and when you app starts the first time, you need to create a new database in system.DocumentsDirectory, create all the necessary tables and insert all the necessary records into those tables on first setup.
system.ResourcesDirectory is read-only… you can’t write to files in that directory. You’ll need to make sure the database is in system.DocumentsDirectory.
I’m not sure how well you’re going to like this answer.
You cannot pre-build an SQLite database in system.DocumentsDirectory. You might be able to get it to work in the simulator because the system.DocumentsDirectory folder is accessible from a Mac or from Windows. However, the app you deploy to iOS or Android is a read-only bundle of compiled and crytpologically signed code and data. You cannot change this in anyway. When the app installs, the OS creates a writable sandbox folder that Corona SDK accesses as system.DocumentsDirectory. This folder will be empty.
It’s your responsibility to include your SQLlite database in your system.ResourcesDirectory (i.e. the folder with main.lua) and when you app starts the first time, you need to create a new database in system.DocumentsDirectory, create all the necessary tables and insert all the necessary records into those tables on first setup.