Book Image

Mastering Cross-Platform Development with Xamarin

Book Image

Mastering Cross-Platform Development with Xamarin

Overview of this book

The main goal of this book is to equip you with the required know-how to successfully analyze, develop, and manage Xamarin cross-platform projects using the most efficient, robust, and scalable implementation patterns. This book starts with general topics such as memory management, asynchronous programming, local storage, and networking, and later moves onto platform-specific features. During this transition, you will learn about key tools to leverage the patterns described, as well as advanced implementation strategies and features. The book also presents User Interface design and implementation concepts on Android and iOS platforms from a Xamarin and cross-platform perspective, with the goal to create a consistent but native UI experience. Finally, we show you the toolset for application lifecycle management to help you prepare the development pipeline to manage and see cross-platform projects through to public or private release.
Table of Contents (19 chapters)
Mastering Cross-Platform Development with Xamarin
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Native libraries


In spite of the fact that the Xamarin framework and .NET core implementations on Xamarin.Android and Xamarin.iOS platforms provide a vast amount of features, in some cases it is unavoidable to include native code in cross-platform implementations. Fortunately, it is possible to bind or link native libraries on both of these platforms.

Managed callable wrappers (Android)

As mentioned in previous chapters, managed callable wrappers are generated managed code libraries which provide a way to interact with the Java Runtime over the JNI bridge to execute code from certain Java libraries.

Java libraries are often packaged in Java archive files (JAR files) and it is possible, using the compiled Java library project, to create a binding library which can be included in Xamarin.Android applications.

In order to demonstrate this usage, we will be creating a MCW for a simple JSON parsing library. The first step of creating our binding library would be to use the built-in project template...