Application Fundamentals

Core Application Concepts

PDF for offline use

Let us know how you feel about this

Translation Quality


0/250

last updated: 2017-09

This section provides a guide on some of the more common things tasks or concepts that developers need to be aware of when developing Android applications.

Understanding Android API Levels

This guide describes how Android uses API levels to manage app compatibility across different versions of Android, and it explains how to configure Xamarin.Android project settings to deploy these API levels in your app. In addition, this guide explains how to write runtime code that deals with different API levels, and it provides a reference list of all Android API levels, version numbers (such as Android 7.1), Android code names (such as Oreo), and build version codes.

Using the SDK Manager

Visual Studio includes an Android SDK Manager that replaces Google's standalone Android SDK Manager. This article explains how to use the SDK Manager to download Android SDK tools, platforms, and other components that you need for developing Xamarin.Android apps.

Resources in Android

This article introduces the concept of Android resources in Xamarin.Android and will document how to use them. It covers how to use resources in your Android application to support application localization, and multiple devices including varying screen sizes and densities.

Activity Lifecycle

Activities are a fundamental building block of Android Applications and they can exist in a number of different states. The activity lifecycle begins with instantiation and ends with destruction, and includes many states in between. When an activity changes state, the appropriate lifecycle event method is called, notifying the activity of the impending state change and allowing it to execute code in order to adapt to that change. This article examines the lifecycle of activities and explains the responsibility that an activity has during each of these state changes in order to be part of a well-behaved, reliable application.

Services

This article covers Android services, which are Android components that allow work to be done in the background. It explains the different scenarios that services are suited for and shows how to implement them both for performing long-running background tasks as well as to provide an interface for remote procedure calls.

Broadcast Receivers

This guide covers how to create and use broadcast receivers, an Android component that responds to system-wide broadcasts, in Xamarin.Android.

Permissions

You can use the tooling support built into Visual Studio for Mac or Visual Studio to create and add permissions to the Android Manifest. This document describes how to add permissions in Visual Studio and Xamarin Studio.

Graphics and Animation

Android provides a very rich and diverse framework for supporting 2D graphics and animations. This document will introduce these frameworks and discuss how to create custom graphics and animations and use them in a Xamarin.Android application.

CPU Architectures

Xamarin.Android supports several CPU architectures, including 32-bit and 64-bit devices. This article explains how to target an app to one or more Android-supported CPU architectures.

Handling Rotation

This article describes how to handle device orientation changes in Xamarin.Android. It covers how to work with the Android resource system to automatically load resources for a particular device orientation as well as how to programmatically handle orientation changes. Then it describes techniques for maintaining state when a device is rotated.

Broadcast Receivers

This guide covers how to create and use broadcast receivers, an Android component that responds to system-wide broadcasts, in Xamarin.Android.

Working With Audio

The Android OS provides extensive support for multimedia, encompassing both audio and video. This guide focuses on audio in Android and covers playing and recording audio using the built-in audio player and recorder classes, as well as the low-level audio API. It also covers working with Audio events broadcast by other applications, so that developers can build well-behaved applications.

Notifications

This section explains how to implement local and remote notifications in Xamarin.Android. It describes the various UI elements of an Android notification and discusses the API's involved with creating and displaying a notification. For remote notifications, both Google Cloud Messaging and Firebase Cloud Messaging are explained. Step-by-step walkthroughs and code samples are included.

Touch

This section explains the concepts and details of implementing touch gestures on Android. Touch APIs are introduced and explained followed by an exploration of gesture recognizers.

Data Access

This section discusses data access in Xamarin.Android using SQLite as the database engine.

HttpClient Stack and SSL/TLS

This section explains the HttpClient Stack and SSL/TLS Implementation selectors for Android. These settings determine the HttpClient and SSL/TLS implementation that will be used by your Xamarin.Android apps.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.