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...