Monday, May 09, 2011

Android for .NET Developers - Building the User Interface

The Android for .NET Developers Series

Part 1 Starting with this article, I'll discuss what you need to know to approach Android programming without any aid from your .NET expertise.
Part 2 In this article, we'll go through an Android application that accepts input from the user and handles user's clicking.
Part 3 In this article, you will learn how to build the user interface.

Introduction
The user interface of native mobile applications often relies on a new family of widgets that do not exist - at least not in the same form - in Web and desktop user interfaces. Rounded panels, data tables, pick lists are fairly common, but I'd also call your attention on the use of bitmaps, icons and gradients that are probably more common than in other types of application.

Any Android project contains a folder of resources and resources are catalogued in subfolders by category - menu, layout, values, drawable. (See Figure 1.) You populate these folders with a bunch of files representing various visuals. In this article, I'll go through a bunch of topics that revolve around the use of resources and illustrate how to accomplish some common tasks such as displaying an image, a rounded panel, localized strings, menus, and modal dialogs. I'll start with the first type of resource you deal with even when your goal is simply writing a hello-world application - the layout resource.
Figure 1: Resources in an Android project.

android-for-net-developersbuilding-the-user-interface-1.jpg

Read more: dotNetSlackers