Cross Platform
Android
iOS
Mac

Introduction to Ice Cream Sandwich

With Xamarin.Android 4

This article describes several of the new features available to application developers with the Android 4 API - Ice Cream Sandwich. It covers several new user interface technologies and then examines a variety of new capabilities that Android 4 offers for sharing data between applications and between devices.

Overview

Android OS version 4.0 (API Level 14) represents a major reworking of the Android Operating System and includes a number of important changes and upgrades, including:

  • Updated User Interface – Several new UI features give developers more power and flexibility when they create application user interfaces. These new features include: GridLayout, PopupMenu, Switch widget, and TextureView.
  • Better Hardware Acceleration – 2D rendering now takes place on the GPU for all Android controls. Additionally, hardware acceleration is on, by default, in all applications developed for Android 4.0.
  • New Data APIs – There’s new access to data that was not previously officially accessible, such as calendar data and the user profile of the device owner.
  • App Data Sharing – Sharing data between applications and devices is now easier than ever via technologies such as the ShareActionProvider, which makes it easy to create a sharing action from an Action Bar, and Android Beam for Near Field Communications (NFC), which makes it a snap to share data across devices in close proximity to each other.

In this article, we’re going to explore these features and other changes that have been made to the Android 4.0 API, and we’ll explain how to use each feature with Xamarin.Android.

User Interface Features

A variety of new user interface technologies are available with Android 4, including:

  • GridLayout – Supports 2D grid layout of controls.
  • Switch widget – Allows toggling between ON or OFF.
  • TextureView – Enables video and OpenGL content within a view.
  • Navigation Bar – Contains virtual buttons for back, home, and multi-tasking.

Additionally, other UI elements have been enhanced, such as the PopupMenu, which is now easier to work with, and tabs, which have a more polished appearance.

Sharing Features

Android 4 includes several new technologies that let us share data across devices and across applications. It also provides access to various types of data that were not previously available, such as calendar information and the device owner’s user profile. In this section we’ll examine a variety of features offered by Android 4 that address these areas including:

  • Android Beam – Allows data sharing via NFC.
  • Calendar API – Provides access to calendar data from the calendar provider.
  • ShareActionProvider – Creates a provider that allows developers to specify sharing actions from the Action Bar.
  • User Profile – Provides access to profile data of the device owner.

x86 Emulators

ICS does not yet support development with an x86 emulator. x86 emulators are only supported with Android 2.3.3, API level 10. See Configuring the x86 Emulator for more information.

Summary

This article covered a variety of the new technologies that are now available with Android 4. We reviewed new user interface features such as the GridLayout, PopupMenu, and Switch widget. We also looked at some of the new support for controlling the system UI, as well as how to work with the TextureView. Then we discussed a variety of new sharing technologies. We covered how Android Beam let’s you share information across devices that use NFC, discussed the new Calendar API, and also showed how to use the built in ShareActionProvider. Finally, we examined how to use the ContactsContract provider to access user profile data.