Building a data access layer using SQLite
In the previous chapter, we focused on project architecture and we discussed the concepts one layer for data access this is where our database layer sits. Our data access layer is where we will be storing local text files.
SQLite is the most commonly used database framework for mobiles. It is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine, and is free to use.
Note
There are other frameworks that Xamarin supports such as ADO.NET and Realm, but it has been proven that SQLite is the most efficient database layer.
The first step in the setup process is to add the following SQLite NuGet packages in our FileStorage.Portable
project:
SQLite.Net.Async-PCL
SQLite.Net.Core-PCL
SQLite.Net-PCL
Once you add these in your packages, they should look like the following:
The next step is to add a new folder called DataAccess
. Inside this folder, create two subfolders called Storable
and Storage...