AndroidView v3.1 - Layouts with Vertical Orientation

This section provides a tutorial example on how to develop a layout resource file to display all fields in all blocks in vertical orientation.

To finish the AndroidView project, I will create a new layout resource file, which defines a top layout and three sub layouts to host detail fields that are created in AndroidView.java.

Here is my first try with .\res\layout\main.xml:

<?xml version="1.0" encoding="utf-8"?>
<!-- AndroidView_layout.xml
 - Version 3.1 - Showing blocks vertically
 - Copyright (c) 2015, HerongYang.com, All Rights Reserved.
-->
<LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:orientation="vertical"
   >
   <LinearLayout 
      android:id="@+id/lContact"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"
   />
   <LinearLayout
      android:id="@+id/lAddress"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"
   />
   <LinearLayout
      android:id="@+id/lAction"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"
   />
</LinearLayout>

Build, install and run the application again on the emulator. My form shows up on the screen:

AndroidView - Vertical Layout Orientation
AndroidView - Vertical Layout Orientation

What do you think about this layout? I don't like it. See next tutorial for my second try.

Last update: 2015.

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows System

 Installation of Android SDK R24 and Emulator

 Installing Apache Ant 1.9 on Windows System

 Developing First Android Application - HelloAndroid

 Android Application Package (APK) Files

 Android Debug Bridge (adb) Tool

 Android File Systems

 Android 4.0.3 File Systems

 AboutAndroid - Application to Retrieve System Information

 android.app.Activity Class and Activity Lifecycle

View Objects and Layout Resource Files

 android.view.View Class - Base of User Interface Components

 View, ViewGroup, Layout, and Widget

 What Is Layout Resource File?

 AndroidView v1.0 - Creating a Layout in Java Class

 AndroidView v2.0 - Creating a Layout in Resource File

 AndroidView v3.0 - Referencing Views in Resource Files

AndroidView v3.1 - Layouts with Vertical Orientation

 AndroidView v3.2 - Layouts with Horizontal Orientation

 AndroidView v4.0 - Inserting Views to Parent Layout

 Using "adb logcat" Command for Debugging

 Build Process and Package File Content

 Building Your Own Web Browser

 Android Command Line Shell

 Samsung Galaxy Tab 3 Mini Tablet

 USB Debugging Applications on Samsung Tablet

 Android Tablet - LG-V905R

 USB Debugging Applications on LG-V905R Tablet

 Android Phone - LG-P925g

 USB Debugging Applications on LG-P925g Phone

 Outdated Tutorials

 References

 PDF Printing Version