You are previewing Xamarin Cross-platform Application Development.
O'Reilly logo
Xamarin Cross-platform Application Development

Book Description

Discover how to streamline the creation of mobile applications for Android and iOS with Xamarin. For C# developers, this book is the most practical way yet to start mastering cross-platform development.

In Detail

Developing a mobile application for just one platform is becoming a thing of the past. Companies expect their apps to be supported on both iOS and Android, whilst leveraging the best native features of both. Xamarin’s tools help solve this requirement by giving developers a single toolset to target both platforms

"Xamarin Cross-platform Application Development" is a step-by-step guide for building professional applications for iOS and Android. The book walks you through building a chat application, complete with a backend web service and native features such as GPS location, camera, and push notifications.

This book begins with iOS and Android application fundamentals, then moves on to sharing code, and eventually digs deeper into native functionality. By the end of the book, readers will have successfully built a cross-platform application ready for submitting to app stores. You will gain an in-depth knowledge about the concepts of building cross platform applications.

"Xamarin Cross-platform Application Development" also covers native iOS and Android APIs, unit testing, building a real web service with Windows Azure, push notifications, interacting with the camera and GPS, leveraging Java and Objective-C libraries, and finally app store submission. Towards the end of the book you will feel confident in developing your own Xamarin applications.

"Xamarin Cross-platform Application Development" will teach you everything you need to know to develop an end-to-end, cross-platform solution with Xamarin.

What You Will Learn

  • Familiarize yourself with Apple's MVC design pattern
  • Understand the Android activity lifecycle
  • Share C# code across platforms
  • Implement a web service with Azure Mobile Services
  • Deploy and debug your application on mobile devices
  • Call native Objective-C or Java libraries from C#
  • Use Xamarin.Mobile for camera, contacts, and location
  • Submit your app to the Apple App Store and Google Play
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Xamarin Cross-platform Application Development
      1. Table of Contents
      2. Xamarin Cross-platform Application Development
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Xamarin Setup
        1. The Xamarin tools
        2. Installing Xcode
        3. Installing Xamarin
        4. Setting up the Android emulator
        5. Enrolling in the iOS Developer Program
        6. Registering as a Google Play developer
        7. Summary
      9. 2. Hello Platforms!
        1. Building your first iOS application
        2. Understanding Apple's MVC pattern
        3. Using Xcode and storyboards
        4. Building your first Android application
        5. Android activities
        6. Xamarin's Android designer
        7. Summary
      10. 3. Code Sharing Between iOS and Android
        1. Learning the MVVM design pattern
        2. Comparing project organization strategies
        3. Working with portable class libraries
        4. Using preprocessor statements
        5. Simplifying dependency injection
        6. Implementing Inversion of Control
        7. Summary
      11. 4. XamChat – a Cross-platform App
        1. Describing our sample application concept
        2. Developing our model layer
        3. Writing a mock web service
        4. Writing the ViewModel layer
          1. Implementing our LoginViewModel class
          2. Implementing our RegisterViewModel class
          3. Implementing our FriendViewModel class
          4. Implementing our MessageViewModel class
        5. Writing unit tests
          1. Setting up a new project for unit tests
          2. Writing assertions
        6. Summary
      12. 5. XamChat for iOS
        1. Understanding the basics of an iOS app
        2. Using UINavigationController
        3. Implementing the login screen
        4. Using segues and UITableView
        5. Adding a friends list screen
        6. Adding a list of messages
        7. Composing messages
        8. Summary
      13. 6. XamChat for Android
        1. Introducing Android Manifest
        2. Adding a login screen
        3. Using ListView and BaseAdapter
        4. Implementing the friends list
        5. Composing messages
        6. Summary
      14. 7. Deploying and Testing on Devices
        1. iOS provisioning
        2. Android device settings
        3. Understanding the linker
        4. Understanding AOT compilation
        5. Avoiding common memory pitfalls
        6. Summary
      15. 8. Web Services with Push Notifications
        1. Learning Windows Azure
        2. Setting up your Azure account
        3. Exploring Azure Mobile Services
        4. Creating tables and scripts
        5. Adding a backend to XamChat
          1. Updating the data types for Azure Mobile Services
          2. Adding the Xamarin component
        6. Using the Apple Push Notification service
          1. Setting up proper provisioning
          2. Setting up your provisioning profile
          3. Setting up a certificate signing request
          4. Making client-side changes for push notifications
        7. Implementing Google Cloud Messaging
        8. Summary
      16. 9. Third-party Libraries
        1. The Xamarin Component Store
        2. Porting existing C# libraries
        3. Objective-C bindings
        4. Java bindings
        5. Summary
      17. 10. Contacts, Camera, and Location
        1. Introducing Xamarin.Mobile
        2. Accessing contacts
          1. Retrieving contacts on Android
        3. Looking up GPS location
          1. Implementing GPS location on Android
        4. Accessing the photo library and camera
          1. Accessing photos on Android
        5. Summary
      18. 11. App Store Submission
        1. Following the iOS App Store Review Guidelines
        2. Submitting an app to the iOS App Store
          1. Creating a distribution provisioning profile
          2. Adding your app to iTunes Connect
          3. Making an iOS binary for the App Store
        3. Signing your Android applications
        4. Submitting the app to Google Play
          1. Google Play Developer Program Policies
        5. Tips for a successful mobile app
        6. Summary
      19. Index