Creating a shared SQLite data access

This recipe demonstrates how to set up a cross-platform Xamarin.Forms solution to use SQLite and create the core most important object: a SQLite connection.

How to do it…

  1. Create a Blank App (Xamarin.Forms Portable) named XamFormsSQLiteDataAccess in Visual Studio from File | New | Project…
  2. For each project, we will add two NuGet packages: SQLite.Net-PCL and SQLite.Net.Async-PCL, a cross-platform SQLite client and ORM. Right-click in the XamFormsSQLiteDataAccess portable core library and choose Manage NuGet Packages, search for the packages, and add them.
  3. Repeat step two for the Android, iOS, and Windows Phone projects.
  4. iOS and Android support SQLite out of the box, whereas Windows Phone needs an extra step. Go to ...

Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.