Sqlite insert in thread lazarus / 43-Android ---------------------------------------------------------------------- dseligo · 2023-12-17 12:07 I can't make jSqliteDataAccess component to work in thread. I tried using already created component (on some form), but InsertIntoTable crashes app. Then I tried creating jSqliteDataAccess in thread, but when I call Init, app crashes. I attached sources which shows my problem. I am testing with real device (Samsung S23). Any advice appreciated. ---------------------------------------------------------------------- Mongkey · 2023-12-17 12:58 Just make sure your db exist, then do request storage permission on every time you open and close db for your safety, android studio would help you much on debuging your app. No need to create thread i think, and i saw your code has no permission request. ---------------------------------------------------------------------- dseligo · 2023-12-17 13:56 Quote from: Mongkey on December 17, 2023, 01:58:44 pmJust make sure your db exist, then do request storage permission on every time you open and close db for your safety, android studio would help you much on debuging your app. No need to create thread i think, and i saw your code has no permission request. Thank you for response. I tried with threads because I'm inserting large amount of data, so I wanted to have feedback (it lasts minute or two). Since there isn't Application.ProcessMessages in Android, I thought I could do it in thread. I solved it using timer and inserting data in chunks. ---------------------------------------------------------------------- Zvoni · 2023-12-18 07:39 Quote from: dseligo on December 17, 2023, 02:56:41 pmThank you for response. I tried with threads because I'm inserting large amount of data, so I wanted to have feedback (it lasts minute or two). Since there isn't Application.ProcessMessages in Android, I thought I could do it in thread. I solved it using timer and inserting data in chunks. You do know, that SQLite offers a Callback that some action has taken place? The only caveat: You are not allowed to use the connection inside that callback, so it should be enough, if you just want to show a progress bar or similiar