O'Reilly logo

Xamarin 4.x Cross-Platform Application Development - Third Edition by Jonathan Peppers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Code Sharing Between iOS and Android

Xamarin's tools promise to share a good portion of your code between iOS and Android while taking advantage of the native APIs on each platform where possible. Doing so is an exercise in software engineering more than a programming skill or having the knowledge of each platform. To architect a Xamarin application for enabling code sharing, it is a must to separate your application into distinct layers. We'll cover the basics as well as specific options to consider certain situations.

In this chapter, we will cover:

  • The MVVM design pattern for code sharing
  • Project and solution organization strategies
  • Portable Class Libraries (PCLs)
  • Preprocessor statements for platform-specific code
  • Dependency Injection ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required