Chapter 6

Designing the User Interface

In This Chapter

  • Setting up the Screen Brightness Toggle application
  • Designing the layout
  • Developing the user interface
  • Adding a TextView button widget
  • Previewing your work

Congratulations! You discovered what Android is and how to build your first application. I'm happy to say that you are now getting into the fun stuff. Over the course of the next few chapters I help you build a real application that you can use and publish to the Android Market.

What kind of application? Well, imagine you're at home, sitting at your favorite breakfast nook and reading the daily news on your tablet. The sun is shining, but you can read your tablet easily. Later that night, when you're sitting up in bed with the lights off, reading your favorite book on that same tablet isn't so easy. In fact, every time you read in bed, you have to open up the tablet's display settings and reduce the brightness to a tolerable level. Although this isn't a huge problem, it is kind of a nuisance. (Some tablets, such as the XOOM, come with features that adjust screen brightness automatically, but for the sake of this example, assume that your tablet does not offer that feature.)

It would be great if you had an application that would allow you to touch a button to switch the brightness of your display. The button would have a bright mode for daytime and another, darker mode for the evening. Tapping the button on the Home screen, then, would toggle between these settings, which would save you a lot of hassle. You'd never have to adjust the brightness again!

That's the application you're about to build. In this chapter you create the user interface portion of the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.42.251