20.08.2016 Views

Professional Android 4 Application Development

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 />

Creating and Using Overlays 546<br />

Creating New Overlays 546<br />

Introducing Projections 547<br />

Drawing on the Overlay Canvas 547<br />

Handling Map Tap Events 548<br />

Adding and Removing Overlays 549<br />

Annotating Where Am I 549<br />

Introducing My Location Overlay 553<br />

Introducing Itemized Overlays and Overlay Items 554<br />

Pinning Views to the Map and Map Positions 556<br />

Mapping Earthquakes Example 558<br />

CHAPTER 14: INVADING THE HOME SCREEN 565<br />

Introducing Home Screen Widgets 566<br />

Creating App Widgets 567<br />

Creating the Widget XML Layout Resource 567<br />

Widget Design Guidelines 567<br />

Supported Widget Views and Layouts 568<br />

Defi ning Your Widget Settings 569<br />

Creating Your Widget Intent Receiver and Adding It to the<br />

<strong>Application</strong> Manifest 570<br />

Introducing the App Widget Manager and Remote Views 572<br />

Creating and Manipulating Remote Views 572<br />

Applying Remote Views to Running App Widgets 574<br />

Using Remote Views to Add Widget Interactivity 575<br />

Refreshing Your Widgets 577<br />

Using the Minimum Update Rate 577<br />

Using Intents 578<br />

Using Alarms 579<br />

Creating and Using a Widget Confi guration Activity 580<br />

Creating an Earthquake Widget 582<br />

Introducing Collection View Widgets 587<br />

Creating Collection View Widget Layouts 589<br />

Creating the Remote Views Service 591<br />

Creating a Remote Views Factory 591<br />

Populating Collection View Widgets Using a Remote Views Service 594<br />

Adding Interactivity to the Items Within a Collection View Widget 595<br />

Binding Collection View Widgets to Content Providers 596<br />

Refreshing Your Collection View Widgets 598<br />

Creating an Earthquake Collection View Widget 598<br />

xxx

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

Saved successfully!

Ooh no, something went wrong!