Xamarin: Xamarin for beginners, Building Your First Mobile App with C# .NET and Xamarin – 4th Edition
- Length: 115 pages
- Edition: 4
- Language: English
- Publication Date: 2021-05-01
- ISBN-10: B093YQ2YX7
The entire world is now surrounded by billions and trillions of mobile Tech which is inevitable. The major share of the development of mobile apps is taken by the Google‘s Android, Apple‘s iOS, and Microsoft‘s Windows. Every new learner or newbie in Mobile Development Domain finds himself in the dilemma of choosing the platform to start with. They are actually looking for a platform to execute or implement the test apps on something different from what it is intended for.
Xamarin is one of the solutions to it which actually is meant for cross-platform mobile app development where you can build Android, iOS, and Windows native application using a single codebase. This single platform is C#. The apps developed using Xamarin performs almost similar to the native Platform applications.
Working of Xamarin
Xamarin has entirely converted the Android and iOS SDK to C# to make it more familiar to the developers. One can easily use the same codebase for both the platforms without the hassle of remembering the syntax of different languages all the time. Besides, the User Interface(UI) remains almost same. It has to be separately built for both the platforms and then has to be bound by the common codebase.
There are actually two ways for building the User Interface. First one is using the original native methods to build the UI. Another one incorporates the use of Xamarin.Forms. These forms can be used to build UI for different platforms all at once and have almost 100% code sharing if these are chosen over Native UI Technology.
After doing all the UI work comes the most challenging phase which is connecting the UI to the codebase. This connection can again be implemented using two code sharing approaches which are:
1.Shared Project
2.Portable Class Libraries(PCL)
Xamarin.Forms
Xamarin provides developers two ways to build a mobile app. Either by using Xamarin.iOS and Xamarin.Android(main approach) or by using Xamarin.Forms which is a framework for simple apps and prototypes. Xamarin.Forms, the Visual Studio Library facilitates for rapid prototyping or building apps with few platform-specific functionalities. This makes Xamarin.Forms, the best fit, for apps considering code sharing more significant than custom UI. The developer need not design for each platform individually. With Xamarin.Forms, a single interface would be shared across platforms. Apps with some parts of the UI created using Xamarin.Forms and rest using native UI Toolkit can also be built using this approach.
What Is Xamarin.Forms?
Xamarin.Forms is a cross-platform natively backed UI toolkit abstraction that allows developers to easily create user interfaces that can be shared across Android, iOS, Windows, and Windows Phone.
Performance
Xamarin apps are fully native so in xamarin you can enjoy fully native performance with shared code.
Xamarin.iOS and Xamarin.Android (Separate UI)
For Xamarin.iOS and Xamarin.Android, you have shared code base in C# .This business logic is shared across platforms and UI is separate for all platforms. This is separate UI approach.
Xamarin.ios and Xamarin.Android give you 100% API coverage with benefits of .NET APIs. Anything you can do in Android or in iOS, you can do with Xamarin using C#.
Windows
Windows already supports C# for development. So, it is also built in C# with native APIs.
Xamarin.Forms
Xamarin.forms allow you more code sharing that you can also share application UI in all platforms.
Included in Xamarin.Forms
UI building blocks like pages, layouts, and controls
XAML-defined UI
Data binding
Navigation
Animation API
Dependency Service
Messaging Center
Advantages of Xamarin.Forms
Native apps
Shared Business Logic
Shared UI
One Xamarin development team require to develop apps for multiple platforms
Less development time