However there is a better solution which Basic4Android doesn't support as far as I can see and that is to use the SQLiteDatabase.NO_LOCALIZED_COLLATORS flag when opening the database.
That fix was also mentioned at in another thread, but the error I was getting was that the only table in my database was "not found". Strange that it was giving you different errors. I guess that the moral is that everyone putting an existing database on a device needs to make sure they have done the fix first.
That fix was also mentioned at in another thread, but the error I was getting was that the only table in my database was "not found". Strange that it was giving you different errors. I guess that the moral is that everyone putting an existing database on a device needs to make sure they have done the fix first.
I found that adding the android_metadata table is all I needed to do and didn't bother with the instructions to rename the primary key field in all the other tables.
However there are plenty of mentions out there that passing SQLiteDatabase.NO_LOCALIZED_COLLATORS flag when initializing the database eliminates that hassle. I just wish that B4A supported that.
However there are plenty of mentions out there that passing SQLiteDatabase.NO_LOCALIZED_COLLATORS flag when initilizing the database eliminates that hassle. I just wish that B4A supported that.
I removed the android_metadata table and tested the app and it works just fine.
Thanks again Erel, I am developing this transit app in tandem with a friend who is doing the iPhone version and it makes using a common SQLite db so much easier.
I have a database created with the SQLite Database Browser (CSV import).
After deployment to the phone, I copied the database file back to the PC and found that a table called "android_metadata" containing a field "locale" = en_US has been created automatically.
Apparently, not all phones or Android versions perform that step automatically, so I believe the modified library is neutral, thus safer (no such locale field added after switching to the new library).