Mastering Cross-Platform Development with Xamarin
eBook - ePub

Mastering Cross-Platform Development with Xamarin

Can Bilgin

Share book
  1. 390 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Cross-Platform Development with Xamarin

Can Bilgin

Book details
Book preview
Table of contents
Citations

About This Book

Master the skills required to steer cross-platform applications from drawing board to app store(s) using Xamarin

About This Book

  • Develop your Xamarin development skills with this comprehensive guide on various patterns and features so you can create elegant and high-quality applications
  • Create adaptive user interfaces on separate platforms without compromising the user experience and platform identity
  • Implement application lifecycle management concepts to manage and finalize cross-platform projects and efficiently collaborate with others

Who This Book Is For

This book is ideal for those who want to take their entry–level Xamarin mobile development skills to the next level to become the go-to person within their organization. To fully understand the patterns and concepts described, you should possess a reasonable level of knowledge about the core elements of Xamarin and cross-platform application development with it.

What You Will Learn

  • Configure your environment for cross-platform projects with Xamarin
  • Gain memory management skills to avoid memory leaks and premature code cycles while decreasing the memory print of your applications
  • Employ asynchronous and parallel patterns to execute non-interactive and non-blocking processes
  • Create and use SQLite databases for offline scenarios
  • Integrate network resources with cross-platform applications
  • Design and implement eye-catching and reusable UI components without compromising nativity in mobile applications
  • Manage the application lifecycle of cross-platform development projects
  • Distribute Xamarin applications through public or private channels

In Detail

The main goal of this book is to equip you with the required know-how to successfully analyze, develop, and manage Xamarin cross-platform projects using the most efficient, robust, and scalable implementation patterns.

This book starts with general topics such as memory management, asynchronous programming, local storage, and networking, and later moves onto platform-specific features. During this transition, you will learn about key tools to leverage the patterns described, as well as advanced implementation strategies and features. The book also presents User Interface design and implementation concepts on Android and iOS platforms from a Xamarin and cross-platform perspective, with the goal to create a consistent but native UI experience.

Finally, we 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.

Style and approach

This is a comprehensive guide on various Xamarin features and patterns. Each topic is explained and demonstrated with code samples, which are revised in each section in an iterative manner and analyzed with available diagnostic tools to demonstrate the benefits of different patterns.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Cross-Platform Development with Xamarin an online PDF/ePUB?
Yes, you can access Mastering Cross-Platform Development with Xamarin by Can Bilgin in PDF and/or ePUB format, as well as other popular books in Informatik & Programmierung von Mobilgeräten. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785285684

Mastering Cross-Platform Development with Xamarin


Table of Contents

Mastering Cross-Platform Development with Xamarin
Credits
About the Authors
About the Reviewers
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Developing with Xamarin
Cross-platform projects with Xamarin
Xamarin as a platform
Xamarin as a product
Target platforms
Xamarin on Android
Xamarin on iOS
Windows Runtime apps
Setting up the development environment
Choosing the right development OS
Xamarin Studio setup and configuration
Visual Studio setup and configuration
Emulator options
Emulators for Android
iOS emulation
A typical Xamarin solution structure
Portable class libraries
Shared projects
Xamarin.Forms
NuGet packages
Components
Quality in cross-development
Reusability
Abstraction
Loose-coupling
Nativity
Summary
2. Memory Management
Application Component lifecycle
Activity lifecycle (Android)
Active/Running
Paused
Backgrounded
Stopped
Restarted
Application lifecycle (iOS)
Garbage collection
GC on Xamarin projects
SGen garbage collector
Boehm garbage collector (iOS only)
Platform-specific concepts
Object reference types
Automatic Reference Counting (ARC)
Troubleshooting and diagnosis
Xamarin Profiler
Allocations instrument
Time Profiler
Device Monitor (Android only)
Instruments (iOS only)
Monotouch Profiler (iOS only)
Patterns and best practices
Disposable objects
The lapsed listener problem
Weak references
Cross-domain objects
Cyclic references (cycles)
Summary
3. Asynchronous Programming
Multithreading on Xamarin
Single thread model
Task-based Asynchronous Pattern
Concurrency model on iOS
Asynchronous methods
Continuation
Cancellation
Progress
Task batches
Parallel execution
Patterns and best practices
Async pattern conversions
Multi-threading with tasks
Exception handling
Initialization pattern
Semaphores
Background tasks
Background tasks on iOS
Services (Android only)
Summary
4. Local Data Management
Data in mobile applications
State
App data
Local files
External data
Application data
Installation directory
Android
iOS
Local storage
Android
iOS
Temporary storage
Local filesystem
SQLite
Patterns and best practices
Application preferences
File picker
Backup/Roaming
Android and Backup API
iOS and ubiquitous storage
Summary
5. Networking
Connected apps
Web services
Transport
Messaging
SOAP/XML services
RESTful services
OData and OAuth
OData
OAuth
SignalR
Patterns and best practices
Async conversions
Data model abstraction
Service cache
Platform-specific concepts
Permissions
NSUrlConnection/NSUrlSession (iOS Only)
Background downloads
Push notifications
Cloud integration
Azure Mobile Services
Azure offline data
Azure authentication
Summary
6. Platform Extras
Content sharing
File pickers and contracts (Windows Store apps)
Document Provider extensions (iOS)
ContentProvider and ContentResolver (Android)
Peripherals
Bluetooth
Wi-Fi Direct
Near Field Communication
Location data
Android location and Google Play services
Location services on iOS
Location data on Windows Runtime
Geofencing
Native libraries
Managed callable wrappers (Android)
Linking versus binding (iOS)
Summary
7. View Elements
Design philosophy
User expectations
Platform imperatives
Hardware dependency
Design metrics on Android
Design metrics on iOS
Design metrics on Windows Runtime
Design elements
The basic layout
Navigation
Horizontal navigation
Vertical navigation
Jump navigation
Content elements
Collection views
UITableView (iOS)
UICollectionView (iOS)
ListView (Android)
GridView (Android)
CardView (Android)
ListView and ListBox (Windows Phone)
GridView (Windows Phone)
Virtualizing panels (Windows Phone)
Modal views
Popover and alerts (iOS)
Flyout, popups, and menus (Windows Phone)
Dialogs (Android)
Text views
Web views
Feedback
Indeterminate progress
Determinate progress
User interaction
Interactive controls
Text input
Dropdown selection
Option selection
Gestures
Summary
8. Xamarin.Forms
Under the hood
Anatomy of Xamarin.Forms
Project structure
Components
Pages
Tabbed page
The MasterDetail page
NavigationPage
CarouselPage
ContentPage
Layouts
Views
Extending forms
Styles
Triggers and behaviors
Custom renderers
Patterns and best practices
Messaging infrastructure
Dependency injection
Shared project versus portable project
Platform-specific fine-tuning
Summary
9. Reusable UI Patterns
Visual assets
Text resources
Xamarin.Android
Xamarin.iOS
Windows Phone
Image resources
Adaptive visual assets
Reusable assets
Localization
Locale and culture
Windows Phone
Xamarin.iOS
Xamarin.Android
Xamarin.Forms
Architectural patterns
MVC
iOS app architecture
MVVM
Windows Runtime
MVVM on Xamarin.iOS and Xamarin.Android
MVVM with Xamarin.Forms
Summary
10. ALM – Developers and QA
Development pipeline
Troubleshooting and diagnostics
Unit testing
Platform-agnostic unit tests
Platform-specific unit tests
UI testing
Xamarin.UITests and Xamarin Test Cloud
Xamarin Test Recorder
Coded UI tests (Windows Phone)
Calabash
Summary
11. ALM – Project and Release Management
Source control
TFVC
Git
TFS/Git scenarios
Git bridge
NuGet packages
Subversion (SVN)
Continuous integration
Visual Studio Team Services
TeamCity
Other
Automated testing
Beta deployment
HockeyApp
Crashlytics
TestFlight
Package distribution
Live telemetry
Xamarin Insights
Application Insights
Summary
12. ALM – App Stores and Publishing
Release packages
Xamarin.Android app package (.apk)
Disabling debugging
Linking
Packing options
Packaging
Xamarin.iOS app bundle (.ipa)
Build options
Linking
Provisioning profile
Windows Phone app package (.appx)
Distribution options
App store(s)
Ad-hoc
Line of Business apps
Private channel distribution (Android)
Apple Developer Enterprise Program
Windows Phone private distribution
Summary
Index

Mastering Cross-Platform Development with Xamarin

Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: March 2016
Production reference: 1280316
Published by Packt Publishing Ltd.
Livery Place
35 ...

Table of contents