Book Image

Android User Interface Development: Beginner's Guide

By : Jason Morris
Book Image

Android User Interface Development: Beginner's Guide

By: Jason Morris

Overview of this book

<p>There are over 30,000 applications for Android that have been downloaded over a million times already. What makes yours any different? Building a compelling user-interface that people understand and enjoy is vital for the survival of a new application in an environment where look and feel may be the only thing between a user purchasing your application; or deleting it forever.<br /><br />Working through examples, code-snippets, and screenshots this book introduces the fundamentals of good user-interface design from a developer's point of view. This book will put you above the rest by showing you how to build striking user interfaces to grasp your app users' attention enough to make them shell out some bucks to buy your application.</p> <p>The <em>Android User Interface Development Beginner's Guide</em> will tell you everything you need to know to style your applications from bottom up. Given the importance of user-interface design on a touch-screen device, this book aims to equip its reader with the knowledge required to build killer Android applications. Starting simply, and keeping things easy, this book will take you on a step-by-step journey to understanding the principals of good user-interface design, and how to implement the best user interfaces on an Android mobile device. It aims at building design understanding on a chapter-by-chapter basis, while introducing platform knowledge through examples.</p>
Table of Contents (18 chapters)
Android User Interface Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Time for action – developing a FrameLayout example


To really understand what a FrameLayout does, and how it can be used, it's best to kick it around a bit with an example. In this example, we'll use a FrameLayout to layer some Button widgets on top of an ImageView, and show-and-hide a TextView message when one of the buttons is clicked.

For this example to work, you're going to need an image to serve as a background image. I'm going to use a photo of one of my friends. As always, place your image in the res/drawable directory, and try to use a PNG file.

  1. Create a new layout resource file named res/layout/frame_layout.xml.

  2. Declare the root element as a FrameLayout consuming all available space:

    <FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
  3. Inside the FrameLayout, create an ImageView to serve as the background image. It should scale to fill all the available space:

    <ImageView android...