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…
- Create a Blank App (Xamarin.Forms Portable) named
XamFormsSQLiteDataAccess
in Visual Studio from File | New | Project… - For each project, we will add two NuGet packages:
SQLite.Net-PCL
andSQLite.Net.Async-PCL
, a cross-platform SQLite client and ORM. Right-click in theXamFormsSQLiteDataAccess
portable core library and choose Manage NuGet Packages, search for the packages, and add them. - Repeat step two for the Android, iOS, and Windows Phone projects.
- 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.