VS Project / Solution Structure for SQLite VS Project / Solution Structure for SQLite sqlite sqlite

VS Project / Solution Structure for SQLite


You are going to have to create a Portable Class Library that can be used by all of those platforms.

In that Portable Class Library, you will need to use an interface and you will have to pass in the platform-specific implementations (WP8 and WindowsRT will require slightly different implementations).

But here is what helped me. There may be some other resources, but this was definitely the best one and the one that allowed me to do exactly what you are looking to do.

It's a series that I followed (and made a few changes along the way) but it helped me immensely.http://nicksnettravels.builttoroam.com/post/2013/06/02/Windows-(RT-and-Phone)-and-Sqlite-(Part-1).aspx

Here are some snippets from Part 4 the series:

create a separate SQLitePCL project and to define a set of interfaces which map to the classes/methods which is exposed by Sqlite-net. I’m not going to bore you with the details but you can see from following image just a couple of the interfaces which will map to classes such as the SQliteConnection, TableMapping and Column.

Regarding the Platform implementations:

For each platform we need to implement these interfaces. This is really a matter of taking the sqlite-net classes, defined in SQLite.cs and SQliteAsync.cs and modifying them to implement the defined interfaces. This isn’t quite as simple as adjusting the class signature to include the appropriate interface but it isn’t far off.

We need to create a separate class library for each platform, eg SQLiteWinRT and SQLiteWP8. It doesn’t matter which platform you start with (I did the phone implementation first) since you’ll be referencing the same classes using the “add as link” technique discussed in the previous post. You might be thinking, if we’re simply going to be adding the same classes to both libraries why they can’t be all in the shared PCL. The answer lies in the conditional compilation statements at the top of the sqlite-net files – these determine how the classes are built for the respective platforms.