Xamarin Cross-platform Application Development

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.

Xamarin Cross-platform Application Development

Jonathan PeppersFebruary 2014

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.

Mapt Subscription

FREE

$29.99/m after trial

eBook

$18.90

RRP $26.99

Save 29%

Print + eBook

$44.99

RRP $44.99

What do I get with a Mapt Pro subscription?

Unlimited access to all Packt’s 5,000+ eBooks and Videos

Early Access content, Progress Tracking, and Assessments

1 Free eBook or Video to download and keep every month after trial

What do I get with an eBook?

Download this book in EPUB, PDF, MOBI formats

DRM FREE - read and interact with your content when you want, where you want, and how you want

Access this title in the Mapt reader

What do I get with Print & eBook?

Get a paperback copy of the book delivered to you

Download this book in EPUB, PDF, MOBI formats

DRM FREE - read and interact with your content when you want, where you want, and how you want

Access this title in the Mapt reader

What do I get with a Video?

Download this Video course in MP4 format

DRM FREE - read and interact with your content when you want, where you want, and how you want

Book Details

ISBN 139781849698467

Paperback262 pages

Book Description

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.

Table of Contents

Chapter 1: Xamarin Setup

The Xamarin tools

Installing Xcode

Installing Xamarin

Setting up the Android emulator

Enrolling in the iOS Developer Program

Registering as a Google Play developer

Summary

Chapter 2: Hello Platforms!

Building your first iOS application

Understanding Apple's MVC pattern

Using Xcode and storyboards

Building your first Android application

Android activities

Xamarin's Android designer

Summary

Chapter 3: Code Sharing Between iOS and Android

Learning the MVVM design pattern

Comparing project organization strategies

Working with portable class libraries

Using preprocessor statements

Simplifying dependency injection

Implementing Inversion of Control

Summary

Chapter 4: XamChat – a Cross-platform App

Describing our sample application concept

Developing our model layer

Writing a mock web service

Writing the ViewModel layer

Writing unit tests

Summary

Chapter 5: XamChat for iOS

Understanding the basics of an iOS app

Using UINavigationController

Implementing the login screen

Using segues and UITableView

Adding a friends list screen

Adding a list of messages

Composing messages

Summary

Chapter 6: XamChat for Android

Introducing Android Manifest

Adding a login screen

Using ListView and BaseAdapter

Implementing the friends list

Composing messages

Summary

Chapter 7: Deploying and Testing on Devices

iOS provisioning

Android device settings

Understanding the linker

Understanding AOT compilation

Avoiding common memory pitfalls

Summary

Chapter 8: Web Services with Push Notifications

Learning Windows Azure

Setting up your Azure account

Exploring Azure Mobile Services

Creating tables and scripts

Adding a backend to XamChat

Using the Apple Push Notification service

Implementing Google Cloud Messaging

Summary

Chapter 9: Third-party Libraries

The Xamarin Component Store

Porting existing C# libraries

Objective-C bindings

Java bindings

Summary

Chapter 10: Contacts, Camera, and Location

Introducing Xamarin.Mobile

Accessing contacts

Looking up GPS location

Accessing the photo library and camera

Summary

Chapter 11: App Store Submission

Following the iOS App Store Review Guidelines

Submitting an app to the iOS App Store

Signing your Android applications

Submitting the app to Google Play

Tips for a successful mobile app

Summary

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

Authors

Jonathan Peppers

Jonathan Peppers is a Xamarin MVP and lead developer on popular apps and games at Hitcents such as the Hanx Writer (for Tom Hanks) and the Draw a Stickman franchise. Jon has been working with C# for over 10 years working on a wide range of projects at Hitcents. Jon began his career working Self-Checkout software written in WinForms and later migrated to WPF. Over his career, he has worked with many .NET-centric technologies such as ASP.Net WebForms, MVC, Windows Azure, WinRT/UWP, F#, and Unity3D.

In recent years, Hitcents has been heavily investing in mobile development with Xamarin, and has development over 50 mobile applications across multiple platforms.

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.