Lines Matching full:contacts
1 page.title=Using the Contacts API
5 improved Contacts API for managing and integrating contacts from multiple
7 sources, the contacts content provider aggregates similar contacts and presents
9 to manage contacts.</p>
11 <p>The new Contacts API is defined in the
16 on how to support the Contacts API in your app.</p>
18 <p>If you'd like to look at an applied example of how to use the new Contacts
24 <h3>Data structure of Contacts</h3>
26 <p>In the new Contacts API, data is laid out in three primary tables:
27 <em>contacts</em>, <em>raw contacts</em>, and <em>data</em>, a structure that
30 specific contact from multiple contacts sources. </p>
32 <img style="margin: 0px auto 10px; display: block; text-align: center; width: 471px; height: 255px;" src="images/contacts-2.png" alt="" border="0">
46 class provides subclasses corresponding to common MIME types for contacts data.
47 If needed, your application or other contacts sources can define additional MIME
53 a single contacts source. For example, a row might define the data associated
58 <li>A row in the <code>Contacts</code> table represents an aggregate of one or
61 <p>As mentioned above, the Contacts content provider automatically aggregates
62 Raw Contacts into a single Contact entry, where possible, since common data
66 href="#aggregation">Aggregation of contacts</a>, below, for more details,
72 <p>When displaying contacts to users, applications should typically operate on
73 the Contacts level, since it provides a unified, aggregated view of contacts
91 <h3 id="aggregation">Aggregation of contacts</h3>
93 <p>When users sync contacts from multiple sources, several contacts might refer
98 the user, the system locates such overlapping contacts and combines them into a
101 <p>The system automatically aggregates contacts by default. However, if needed,
108 (overlapping) raw contacts with which to aggregate it. It may not find any
109 matching raw contacts, in which case it will create an aggregate contact that
111 new contact that contains the two raw contacts. And it may even find multiple
112 similar raw contacts, in which case it chooses the closest match. </p>
114 <p>Two raw contacts are considered to be a match if at least one of these
125 raw contacts are also sharing some other data like a phone number, an
128 <li>At least one of the two raw contacts is missing the name altogether
165 it changes in such a way that it no longer matches the other raw contacts in the
171 <p>To keep two raw contacts unconditionally together or unconditionally apart,
179 <p>The new Contacts API introduces the notion of a lookup key for a contact. If
180 your application needs to maintain references to contacts, you should use lookup
183 {@link android.provider.ContactsContract.Contacts} table. Once you have a lookup key,
186 <pre>Uri lookupUri = Uri.withAppendedPath(Contacts.CONTENT_LOOKUP_URI, lookupKey)</pre>
190 <pre>Cursor c = getContentResolver().query(lookupUri, new String[]{Contacts.DISPLAY_NAME}, ...);
205 that concatenates the server-side identities of the raw contacts. Your
218 lookup key and track down the constituent raw contacts. If your app
219 bulk-processes contacts, you should maintain both IDs. If your app works with a
236 <p>If you have an existing application that uses the older Contacts API,
240 <li>Leave it as-is and rely on the Contacts compatibility mode.</li>
254 declared as public constants in the {@link android.provider.Contacts} class.
258 for long. The main reason is that it will only have access to contacts from one
261 not be able to access those contacts.</p>
270 <li>Replace all usages of {@link android.provider.Contacts} with calls to new
277 <code><uses-sdk></code> element. To use the new Contacts API, you should
306 <li>Replace all usages of the older Contacts API with calls to new API.
315 to the <code><uses-sdk></code> element. To use the new Contacts API,
341 {@link android.provider.Contacts} into one class, such as ContactAccessorOldApi.
381 return new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI);
420 <p>We hope you like the new features and APIs we've added to Contacts in