The problem of access to SQLite

Hi everybody!
I am developing an app for our own delivery business on android in xamarin/VS. I am using SQLite DB for storing data that workers collect and have problem with opening DB. Actually we have tested and using the app for a while but workers complain that program sometimes “exits” unexpectedly, not saving their changes. I tried to find in which circumstances program crashes and cannot find a clue why it fires cannot open DB error. I tried various combinations and it seems that error fires randomly not in certain conditions. It seems android somehow manages memory and does not allow my app to open DB file. Can someone give me advice what can I do to solve this problem?


  • GioanLeGioanLe USMember
    edited November 2016

    @Pozitiv check in your code that you close the DB somewhere before you do an insert/update/delete. You can use a Singleton pattern to access to DB. See the article may help you.

Sign In or Register to comment.