14.01.2013 Views

Android™ Application Development - Bahar Ali Khan

Android™ Application Development - Bahar Ali Khan

Android™ Application Development - Bahar Ali Khan

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 4: Creating User Interfaces<br />

112<br />

10. Finally, to ensure a consistent UI, modify the main.xml layout to hide the text entry box until<br />

the user chooses to add a new item.<br />

<br />

Running the application should now let you trigger the Activity menu to add or remove items from the<br />

list, and a Context Menu on each item should offer the option of removing it.<br />

Summary<br />

You now know the basics of creating intuitive User Interfaces for Android applications. You learned<br />

about Views and layouts and were introduced to the Android menu system.<br />

Activity screens are created by positioning Views using Layout Managers that can be created in code<br />

or as resource fi les. You learned how to extend, group, and create new View-based controls to provide<br />

customized appearance and behavior for your applications.<br />

In this chapter, you:<br />

❑<br />

❑<br />

❑<br />

❑<br />

❑<br />

Were introduced to some of the controls and widgets available as part of the Android SDK.<br />

Learned how to use your custom controls within Activities.<br />

Discovered how to create and use Activity Menus and Context Menus.<br />

Extended the To-Do List Example to support custom Views and menu-based functions.<br />

Created a new CompassView control from scratch.<br />

Having covered the fundamentals of Android UI design, the next chapter focuses on binding application<br />

components using Intents, Broadcast Receivers, and Adapters. You will learn how to start new Activities<br />

and broadcast and consume requests for actions. Chapter 5 also introduces Internet connectivity and<br />

looks at the Dialog class.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!