Closed AndyDentFree closed 8 years ago
Xamarin's SQLite.Net Working with a Local Database article describes how it's supplied with a PCL
Comment copied from duplicate recent issue:
When you create a cross-platform app with Xamarin, be it using Xamarin Forms or Native UI, you are given the option of creating with SharedProject or PCL.
SharedProject means the common code is recompiled in the context of the IOS or Android targets.
PCL is the Portable Class Library profile which means your shared code is compiled once against a generic .NET API.
As the shared code includes the business logic, people need to be able to use Realm in there.
Currently, we don't have a Realm package for PCL and if you try to add Realm you get an error
Could not install package 'Realm 0.71.1'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
Reactive UI slack channel comments, within the last 12 hours:
Geoff Huntley (who is beta testing) said:
PCL support is super important. Like top priority territory. If your database cannot be used from a PCL it is useless. PCL is like the bumper lanes being up in bumper bowls BUT WITH NO DOWNSIDES.
Paul Betts said:
If you're a general-purpose lib, you have to PCL There's no way to put a shared project lib into a NuGet package If you shared-project it, it means that people who are PCL'ing can't use your project at all
Kent Boogart said:
PCLs enforce an architectural layering that prevents platform code from sprouting up in the wrong place. It’s just cleaner and clearer to work with.
Based on the feedback and current interest from the channel, Andy spending a day or two on trying to get PCL going largely as "parallel implementation".
Many of the introductory videos on how to work with Xamarin for cross-platform projects, especially with Xamarin Forms, show the use of a PCL for the common business logic.
The current (Xamarin 4) release ships with templates allowing you to choose either starting with a SharedProject or PCL.
Whilst we can require people use only a SharedProject for the MVP, prior to release we have to ensure we can work with a PCL. That might just be a documentation task or require a separate package.