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.

Contents<br />

Introducing Layouts 79<br />

Using Layouts 79<br />

Creating New Views 80<br />

Modifying Existing Views 81<br />

Creating Compound Controls 85<br />

Creating Custom Widgets and Controls 88<br />

Using Custom Controls 98<br />

Creating and Using Menus 99<br />

Introducing the Android Menu System 99<br />

Defi ning an Activity Menu 101<br />

Dynamically Updating Menu Items 104<br />

Handling Menu Selections 104<br />

Submenus and Context Menus 105<br />

To-Do List Example Continued 107<br />

Summary 112<br />

Chapter 5: Intents, Broadcast Receivers, Adapters, and the Internet 113<br />

Introducing Intents 114<br />

Using Intents to Launch Activities 114<br />

Using Intent Filters to Service Implicit Intents 121<br />

Using Intent Filters for Plug-ins and Extensibility 130<br />

Using Intents to Broadcast Events 132<br />

Introducing Adapters 136<br />

Introducing Some Android-Supplied Adapters 136<br />

Using Adapters for Data Binding 136<br />

Using Internet Resources 141<br />

Connecting to an Internet Resource 142<br />

Leveraging Internet Resources 143<br />

Introducing Dialogs 143<br />

Introducing the Dialog Class 144<br />

Using Activities as Dialogs 147<br />

Creating an Earthquake Viewer 148<br />

Summary 157<br />

Chapter 6: Data Storage, Retrieval, and Sharing 159<br />

Android Techniques for Saving Data 160<br />

Saving Simple <strong>Application</strong> Data 160<br />

Creating and Saving Preferences 161<br />

Retrieving Shared Preferences 161<br />

Saving the Activity State 162<br />

Creating a Preferences Page for the Earthquake Viewer 165<br />

xi

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

Saved successfully!

Ooh no, something went wrong!