Todo
Xamarin.Forms provides two solution templates for building cross-platform applications: PCL or Shared Project. This Todosample application is provided using both templates. The Xamarin.Forms application code is fundamentally the same, except where the database connection is created (because it requires a file-system reference to the SQLite data file).
NOTE:
Windows Phone requires you to download Precompiled Binaries for Windows Phone 8 VSIX and install in Visual Studio; this enables the SQLite for Windows PhoneExtension that you can then add to your app.
PCL (Portable Class Library)
This solution uses the SQLite.NET PCL NuGet to provide a cross-platform implementation of the SQLite database API. The shared PCL project references the NuGet to implement the TaskDatabaseclass. Platform-specific instances of the SQLiteConnection are created and injected on each platform (in AppDelegate,MainActivity, and MainPage).
Shared Project
This version uses the raw C# source of SQLite.NET in the Shared Project, which is accessed by the TaskDatabase class. There is a compiler-directive (#if __IOS__) in the TaskDatabase class that is used to determine the correct filename for each platform.
Author : https://github.com/rzaitov.
If you like this tutorial then you can download full copy of the code from github.
Leave a Reply