Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

SQLite .NET Standard / PCL

MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭

This is a fork of a popular SQLite wrapper:

There are two main differences:

  • Provide a .NET Standard library that sits across the three main platforms: UWP, Android, and iOS with no platform specific libraries.
  • Provide flat table access with SQL queries. I.e. not being forced to use language integrated ORM like functionality.

The common wrapper forces you to use its own ORM like structure that doesn't allow for flat table access. This is fine if you are only doing basic stuff, but it doesn't allow for complex joins etc. It also also not suitable for scenarios where you have written your own ORM. This version has been written so that you can build your own data layer on top of SQLite. But, more importantly, it is a single project that is compatible with all Xamarin platforms: iOS, Android, UWP. You don't need any platform specific libraries to run it.

Note: the original ORM like functionality will eventually be removed so please don't use it.


  • MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭


    The library and all files associated has been stripped right back to bare bones basics. It has been moved here:

    You should be able to install the NuGet package with:
    Install-Package SQLite.Net.Standard

    The example is extremely simply to get running. Just Clone, open in VS 2017, and hit run.

  • DrewEDrewE USMember ✭✭

    Hey Christian - I pulled in the library, and testing with Visual Studio emulators worked fine for android. When I installed my app on my actual phone, I got the following error.

    Just to be sure that the issue wasn't with my app, I deployed the sample stocks app to my phone. Although it manifested itself at a different time, I got the same error.

    Had you tried deploying it an actual device, and did you run into this? My device is running Android 7.0.

    The interesting thing is that the database file is still getting saved and persisted across application starts. So although functionality is not broken, the pop-up probably is good to have showing up every time the app is opened.

    I read some articles about SQLite libraries needing to be upgraded, yada-yada. However, I don't think that applies to your project because - well - your library is my sqlite package. ;)

    Any thoughts on how to avoid this popoup?


  • MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭

    Thanks Drew. I have tested this thoroughly on Android 7.1 but I've never tested it on 7.0. It's always hard to diagnose these things without access to the device where the actual problem occurred.

    Could you please log this as an issue here:

    Also, please attach any images as you have done, and also attach any logging information from the Android logging tool. It might give me some hints.

    It may be that Android 7.0 doesn't have the same version of the base SQLite C++ library that my project references...

  • MelbourneDeveloperMelbourneDeveloper AUMember ✭✭✭

    Wait, actually, this error message rings some bells!

    Are you perhaps letting the phone go to sleep? I have seen this error message pop up when the phone goes to sleep. It's never actually affected the persistence of data, but it does look horrible.

  • DrewEDrewE USMember ✭✭

    So - a couple of things.

    The message does in fact appear in the stocks app after the phone sleeps. In my app, the message appears immediately upon app start-up.

    I will create an issue in your repo, include some screenshots, and will gather up whatever logs I can for you this evening. I will also try to narrow down what call into your library is causing the pop-up.


Sign In or Register to comment.