XAMARIN PCL vs SAP
Xamarin is a cross-platform development of the CLI and Common Language Specifications.
Developers can use Xamarin platform to develop native Android, iOS, and Windows apps with native UI and share code across all three platforms.
Development in Xamarin means making native apps in cross platform.
- It’s more reliable and flexible.
- Achieve native performance.
There are Two Approaches to Create Xamarin Cross-Platform Apps
- PCL (Portable Class Library)
- SAP (Shared Asset Project)
Both are shared codes between all platforms like Android, iOS, Windows but in different ways.
In PCL approach, common codes are bundled into dynamic link library that refer to each application projects and binds to at run time. In this approach code platform specific is written in platform specific project. The PCL project can be easily referenced to other projects in an application, or the output assembly can be shared for others to reference in their solutions.
In SAP approach the common code files are included with each of the application projects at build time. Initially, the SAP has only a single file. We can write all three platform codes in single file using some of C# directives like #if _IOS_, #if _ANDROID_, #if _WINDOWS_APP. In this approach code, all three platforms are at one place, so it is more productive and easy to maintain.