Book Image

Xamarin: Cross-Platform Mobile Application Development

By : George Taskos, Jonathan Peppers, Can Bilgin
Book Image

Xamarin: Cross-Platform Mobile Application Development

By: George Taskos, Jonathan Peppers, Can Bilgin

Overview of this book

Developing a mobile application for just one platform is becoming a thing of the past. Companies expect their apps to be supported on iOS, Android, and Windows Phone, while leveraging the best native features on all three platforms. The primary goal of this course is to equip you with the knowledge to successfully analyze, develop, and manage Xamarin cross-platform projects using the most efficient, robust, and scalable implementation patterns. Module 1 is a step-by-step guide to building real-world applications for iOS and Android. The module walks you through building a chat application, complete with a backend web service and native features such as GPS location, camera, and push notifications. Additionally, you'll learn how to use external libraries with Xamarin and Xamarin.Forms. Module 2 provide you recipes on how to create an architecture that will be maintainable, extendable, use Xamarin.Forms plugins to boost productivity. We start with a simple creation of a Xamarin.Forms solution, customize the style and behavior of views for each platform. Further on, we demonstrate the power of architecting a cross-platform solution. Next, you will utilize and access hardware features that vary from platform to platform with cross-platform techniques. In the last and the final Module, you will learn about essential tools to leverage the pattern and advanced implementation strategies. We'll 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. After the completion of this course, you will learn a path that will get you up and running with developing cross-platform mobile applications and help you become the go-to person when it comes to Xamarin. This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products: ?Xamarin Cross-platform Application Development - Second Edition by Jonathan Peppers ?Xamarin Cross-Platform Development Cookbook by George Taskos ?Mastering Cross-Platform Development with Xamarin by Can Bilgin
Table of Contents (6 chapters)

Chapter 6. One for All and All for One

In this chapter, we will cover the following recipes:

  • Creating cross-platform plugins
  • Taking or choosing photos
  • Querying the GPS location
  • Querying the OS contacts

Introduction

With Xamarin.Forms you can also create a cross-platform UI and customize it or mix and match native-Xamarin.Forms. Amazing!

That's all good, but you can't access the native platform features from shared code and in our shared code we have all our POCO data objects, networking service classes, data access components, Models, ViewModels, and business logic. If you try to reference shared code in your native code and start applying logic then you start repeating code between platforms, messing with spaghetti code, and that leads to complex, non-readable, and hard to debug code.

All platforms have common capabilities. Android, iOS, and Windows have battery, GPS, notifications, settings, Bluetooth, text to speech, and maps, but all are used with their corresponding native...