Question

Hi i have been searching over the net for a few hours but can't find any example of Xamarin.MAc using SQLite can any of you guide me on the right path? since have been awful to try to make the app i want with such little (i meant none) documentation

Thank you

Was it helpful?

Solution

Responding to my question, you can use sqlite-net and works perfectly fine, but no on PCL (guess someone have to make the implementation or something like that for this platform).

OTHER TIPS

Xamarin has quite a few examples for iOS using SQLite. The easiest being Tasky:

https://github.com/xamarin/mobile-samples/tree/master/TaskyPro

Case Study of Tasky:

http://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/case_study-tasky/

This example uses a core library which is where the SQLite database code is stored. This particular example uses Linq to interact with the database, though that's not required. The iOS specific code interacts with the TaskManager.

The database structure goes as follows:

TaskDatabase-> TaskRepository-> TaskManager

  • TaskDatabase is where the database is initialized and the database
    functions are written.
  • TaskRepository references the database
    functions and also contains the database path and manages the
    connection. If you wanted to write pure sql, you'd do that here.
    TaskManager references the functions outlined in
  • TaskRepository -
    this is what the iOS, Android, and Windows projects call in order to interact with the database.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top