There are different class libraries I can create in VS 2015 with Xamarin installed:
I would love to know the difference between each - just a brief would do :)
The Scenario
Our team is currently developing a new project which we are targeting for multiple platforms - web and mobile (Xamarin) primarily. While we decided to focus on the MVC web app first, we want to create a single project to contain all models and business classes (logic) so that it can be used across our projects later on. Which class library would be the most appropriate?
This question has a pretty large scope, I'll try answer as best I can:
A standard .NET class library which outputs a DLL. This project type can only be used on Desktop platforms (Mac, Windows). These project types cannot be referenced by Android and IOS projects.
An Android specific class library similiar to a normal Android library. This project is designed to share Android-specific resources such as activities, fragments, views, drawables, strings etc. This project can only be referenced by Android App projects or other Android library projects.
We've typically put our main Android app into a library then done a splash screen only Android Application that links the library project. This is so we can isolate each screen into a seperate "Testbed" application to test each screen independently without needing to go through the entire app to test them.
This type isn't in my VS install so I can't comment on what it is.
A Portable Class Library that targets .NET 4.5 including support for Windows 8, Xamarin.Android, Xamarin.iOS and Xamarin.iOS (classic). This is TargetFrameworkProfile Profile7
.
A Portable Class Library that targets .NET 4.5 with support for Windows 8, Windows Phone 8.1, Windows Phone Silverlight 8, Xamarin.Android, Xamarin.iOS and Xamarin.iOS (classic). This is TargetFrameworkProfile Profile259
.
A Portable Class Library that targets .NET 4.5 with support for Windows 8, Windows Phone 8.1, Windows Phone Silverlight 8, Xamarin.Android, Xamarin.iOS (classic), Xamarin.iOS Unified and Xamarin.Mac Unified. This is TargetFrameworkProfile Profile78
.
Note that the libraries Portable for Universal Apps, Xamarin.Forms and Portable are identical project types (a PCL library) except Xamarin.Forms includes support for the greatest number of platforms.
In terms of project structure, we have a project for each platform (Android, iOs, Windows) that references a PCL (that defines our interfaces and DB entities) and a shared project that implements the majority of the application logic.
I suggest reading the following links and using the Tasky source code as a basis for your application:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With