Android Landscape Layout example

In this post, we will be discussing about how to handle screen orientation changes  in Android application. Users will often switch to landscape orientation for comfort or more horizontal screen space, but we must make sure that controls are accessible to User even if screen orientation is changed and also should feel comfortable to work on it.

We will take “Button listener” example(Button Listener – Make the cat start Meowing) to demonstrate how the controls change its position, size etc when the screen orientation is changed and also how to organize the controls when the orientation is changed to landscape layout.

Portrait and landscape view of “Button listener” application (Before adding landscape layout):

Read More

Android TableLayout example

What is Android layout?

Layout denotes the architecture of the application, where and how the controls should be organized in the UI.It defines the layout structure and holds all the elements that appear to the user.

Android allows us to create layouts for the applications using simple XML file and those layouts must be placed in /res/layout folder.

We can declare the layout in two ways and here we will discuss first way of doing it:

  1. Declare UI elements in XML
  2. Create UI elements at runtime using Java.
Read More

Android RelativeLayout example

What is Android layout?

Layout denotes the architecture of the application, where and how the controls should be organized in the UI.It defines the layout structure and holds all the elements that appear to the user.

Android allows us to create layouts for the applications using simple XML file and those layouts must be placed in /res/layout folder.

We can declare the layout in two ways and here we will discuss first way of doing it:

  1. Declare UI elements in XML
  2. Create UI elements at runtime using Java.
Read More

Android LinearLayout example

What is Android layout?

Layout denotes the architecture of the application, where and how the controls should be organized in the UI.It defines the layout structure and holds all the elements that appear to the user.

Android allows us to create layouts for the applications using simple XML file and those layouts must be placed in /res/layout folder.

We can declare the layout in two ways and here we will discuss first way of doing it:

  1. Declare UI elements in XML
  2. Create UI elements at runtime using Java.
Read More
Page 2 of 212

Pin It on Pinterest