File: _index.html

package info (click to toggle)
android-platform-development 10.0.0%2Br36-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 135,564 kB
  • sloc: java: 160,253; xml: 127,434; python: 40,579; cpp: 17,579; sh: 2,569; javascript: 1,612; ansic: 879; lisp: 261; ruby: 183; makefile: 172; sql: 140; perl: 88
file content (31 lines) | stat: -rw-r--r-- 1,733 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<p>This sample demonstrates the use of XML adapters.</p>

<p>An XML Adapter is an XML file which defines the bindings between the data
retrieved from a
<a href="../../../reference/android/content/ContentProvider.html"><code>ContentProvider</code></a>
and the different views of a layout. They are provided by the
<a href="../../../reference/android/widget/Adapters.html"><code>Adapters</code></a>
class.</p>

Three list activities are provided which illustrate this:
<ul>
  <li><a href="src/com/example/android/xmladapters/ContactsListActivity.html"><strong>
  ContactsListActivity</strong></a> uses the device's Contacts provider as its input source.
  Contacts with a phone number are displayed, their photo being retrieved by a dedicated
  <a href="src/com/example/android/xmladapters/ContactPhotoBinder.html"><code>ContactPhotoBinder
  </code></a>.</li>

  <li><a href="src/com/example/android/xmladapters/PhotosListActivity.html"><strong>
  PhotosListActivity</strong></a> retrieves an RSS photo feed and displays the images and their
  titles. The images are downloaded from the URL found in the feed using the
  <a href="src/com/example/android/xmladapters/ImageDownloader.html"><code>ImageDownloader</code>
  </a> helper class.</li>

  <li><a href="src/com/example/android/xmladapters/RssReaderActivity.html"><strong>
  RssReaderActivity</strong></a> also displays items extracted from an RSS feed. An additional
  <a href="src/com/example/android/xmladapters/UrlIntentListener.html"><code>UrlIntentListener
  </code></a> is used to open a browser when one of the news item is tapped.</li>
</ul>

<img alt="XmlPhotosAdapter" src="../images/XmlPhotosAdapter.png" />
<img alt="XmlRssReader" src="../images/XmlRssReader.png" />