page.title=Hello, Views @jd:body

This is a collection of "Hello World"-style tutorials designed to get you started quickly with common Android layouts and widgets.

A certain amount of knowledge is assumed for these tutorials. Before you start, you should have completed the Hello, World tutorial—it will teach you several things about basic Android development. More specifically, you should know:

Note: In order to make these tutorials as simple as possible, some code may not conform to best practices for coding Android applications. In particular, hard-coded strings are used in places, when the better practice is to reference strings from a res/values/strings.xml resource file.

Tip: After you have pasted sample code into an Eclipse project, press Ctrl (or Cmd) + Shift + O to import the required packages.

Layouts

Linear Layout
Relative Layout
Table Layout
Grid View
Tab Layout
List View

 

Widgets & Other Views

Date Picker
Time Picker
Form Stuff
Spinner
Auto Complete
Gallery
Google Map View
Web View

There are plenty more layouts and widgets available. See the {@link android.view.View} class for more on View layouts, and the {@link android.widget widget package} for more useful widgets. And for more raw code samples, visit the Api Demos.