Android Application Development




User Interface: Layout Basics
User Interface: Layouts
● In the Android developer community the term layout is
  used to mean one of the following two things:
   ○ A type of resource that defines what is drawn on the
      screen. Layout resources are stored as XML files in the
      /res/layout resource directory for the application. A
      layout resource is simply a template for a user
      interface screen or portion of a screen.
   ○ A type of view class whose primary purpose is to
      organize other controls. These layout classes
      (LinearLayout, RelativeLayout, TableLayout etc.)
      are used to display child controls, such as text
      controls or buttons or images on the screen.
● Android user interfaces can be defined as layout
  resources in XML or created programmatically.
User Interface: Layout in Eclipse
Defining an XML Layout Resource
● The most convenient and maintainable way to design UI
● Simplifies the UI design process
● This way, we can separate view and logic easily
Defining a Layout Programmatically

Ui layout (incomplete)

  • 1.
    Android Application Development UserInterface: Layout Basics
  • 2.
    User Interface: Layouts ●In the Android developer community the term layout is used to mean one of the following two things: ○ A type of resource that defines what is drawn on the screen. Layout resources are stored as XML files in the /res/layout resource directory for the application. A layout resource is simply a template for a user interface screen or portion of a screen. ○ A type of view class whose primary purpose is to organize other controls. These layout classes (LinearLayout, RelativeLayout, TableLayout etc.) are used to display child controls, such as text controls or buttons or images on the screen. ● Android user interfaces can be defined as layout resources in XML or created programmatically.
  • 3.
  • 4.
    Defining an XMLLayout Resource ● The most convenient and maintainable way to design UI ● Simplifies the UI design process ● This way, we can separate view and logic easily
  • 5.
    Defining a LayoutProgrammatically