Talk:Mobile Tutorial: Using FireDAC and SQLite (iOS and Android)

From RAD Studio
Jump to: navigation, search


I have spent hours and sweared a bit :-) as the proposed demo was not working. Once everything was fine in the Windows version (W) , the Android application (A) would start and crash.

I was able to determine that the problem was with the database location but no real clue until I did build step by step the actions and give feedabck messages.

So I started by setting the path in button 1 (see added unit). Fine in W & A

Then I started to add messages on the configuration in button 2. Fine in W & A

Then I activated the files. Fine in W & A

Then I added the Tlistview, linked all together and then fine in W but bang ! the A app did crash.

The issue is simply that you have to deactivate the connection and the query before starting the application in Android. May seem obvious but I honestly think the tutorial should insist on this point...

Hope it helps.

Precaution if you update the database contents during development

If you use a sqlite3 database created on the PC in Windows and then include it in the apk, be sure to delete the existing copy of the application on your mobile if you change the database contents during the development.

I had added a new table, compliled, linked, packaged ... till the run on the mobile but the new table was not found. Uninstalling the application on the mobile before running it did solve the issue.