Android contacts provider directory

Android platform documentation. An ExportSupport setting that indicates that the directory allow its data copied to any contacts account. An ExportSupport setting that indicates that the directory does not allow any data to be copied out of it. One of F:Android. PhotoSupportF:Android.

Work profile contacts

An ShortcutSupport setting that indicates that the directory allow creation of shortcuts for data items like email, phone or postal address, but not the entire contact. An ShortcutSupport setting that indicates that the directory allow creation of shortcuts for contact as well as their constituent elements. An ShortcutSupport setting that indicates that the directory does not allow any shortcuts created for its contacts.

The type of directory captured as a resource ID in the context of the package PackageNamee. Returns the unique instance of Class that represents this object's class. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code. Causes a thread which is waiting on this object's monitor by means of calling one of the wait methods to be woken up.

Causes all threads which are waiting on this object's monitor by means of calling one of the wait methods to be woken up. Notifies the system of a change in the list of directories handled by a particular directory provider. Sets the Handle property. Causes the calling thread to wait until another thread calls the notify or notifyAll method of this object. Causes the calling thread to wait until another thread calls the notify or notifyAll method of this object or until the specified timeout expires.

ContactsContract.Directory

Skip to main content. Exit focus mode. Contacts Contract. Directory Contacts Contract. Directory Class Definition Namespace: Android. Provider Android.

Contacts Provider

Provider Assembly: Mono. A Directory represents a contacts corpus, e. Object Object. Is this page helpful? Yes No. Any additional feedback?

Android contacts provider directory

Skip Submit. AccountName AccountName. AccountType AccountType. ContentType ContentType. Default Default.

Android contacts provider directory

DirectoryAuthority DirectoryAuthority. DisplayName DisplayName. EnterpriseDefault EnterpriseDefault.

Where are my contacts stored on Android?

ExportSupport ExportSupport. LocalInvisible LocalInvisible. PackageName PackageName.Devices with work profiles store contacts in separate local directories for the work and personal profiles.

By default, when an app runs in the personal profile, it doesn't display the work contacts. However, an app can access contact information from the work profile. For example, an app that does this is Google's Android Contacts app which shows both personal and work-directory contacts in search results. Users often want to use their personal devices and apps for work.

Consider how your app might present contact information from the work profile. The best approach depends on the nature of your app and the reason that people use it, but think about the following:. Your app should clearly indicate a work profile contact. Perhaps you can badge the contact using a familiar work icon—like a briefcase.

As an example, the Google Contacts app shown in figure 1 does the following to list a mix of work and personal profile contacts:. Depending on how you use work-profile contacts, you can silently leave these contacts out or you might need to disable user interface controls. An IT admin can block the work profile sharing contact information with the personal profile. If an IT admin blocks access, your contact searches are returned as empty results.

To test these permissions, see the Developement and testing section. You can get contacts from the work profile using the same APIs and processes that your app uses to get contacts in the personal profile. The enterprise URI for contacts is supported in Android 7. You need to make the following adjustments to the URI:. Changing the URI works with any content provider mechanism such as a CursorLoader —ideal for loading contact data into user interfaces because data access happens on a worker thread.

For simplicity, the examples in this guide call ContentResolver. Many organizations use remote directories, such as Microsoft Exchange or LDAP, that contain contact information for the entire organization.

Note that these directories typically contain thousands of contacts, and your app also needs an active network connection to search them. Query the Directory. Searching work-profile directories is supported in Android 7.

Because Android stores contact information in different types of local and remote directories, the Directory class has methods you can call to find more about a directory:. The example fetches the ID and package name for the directory.

To display a user interface that helps users pick a contact-directory source, you might need to fetch more information about the directory. To see other metadata fields that might be available, read the Directory class reference.

Apps can query PhoneLookup. You can get lookup results from both personal and work profile contacts provider if you replace this URI with PhoneLookup. This work-profile content URI is available in Android 5. The following example shows an app querying the work-profile content URI to configure the user interface for an incoming call:.

Your app can get personal or work contact data for an email address by querying Email. Querying this URL first searches the personal contacts for an exact match. If the provider doesn't match any personal contacts, the provider then searches work contacts for a match.

This URI is available in Android 6. Apps running in the personal profile can show a contact card in the work profile. Call ContactsContract. The following example shows how you can get the URI and then show the card:.Want to know where your contacts are stored on Android device? You'll get the answer in this article! What's more, you also can find effective 4 ways to backup and export contacts on Android and Samsung Galaxy phone. Now let's check! The contacts storage location varies on phones released by different manufacturers.

But it's easy to find the contacts database stored on your Android phone and tablet. The problem is, the file is in SQLite3 format. And it's a tedious work to browse the Android contacts database file. Root your device and use the command line sqlite3 client and copy the contact database to your computer.

But must you go through all these? No, you absolutely can export or backup your Android contacts using much easier methods. And I'll show you how in the following sections.

It would be much easier if you store your Android contacts to SIM card. And you can conveniently transfer contacts from phone to phone later. Step 2. You don't have to download any 3 party apps or software. But the backup will be stored on the internal storage on device. Here are the simple steps. Step 4. Tap "Internal storage" and then select the export location. Step 5.Joinsubscribers and get a daily digest of news, geek trivia, and our feature articles. Android does a great job of keeping all your contacts in sync with your Google account, so theoretically you should never lose all your contacts.

That said, things happen, and keeping a backup is never a bad idea. Fire up the app, and then swipe in from the left side to open the menu. This way you have a backup stored in the cloud. Go ahead and fire up the Contacts app. You only have one option for an export location here: Internal Storage though it may show SD cards as well. The exported file contacts. The Best Tech Newsletter Anywhere. Joinsubscribers and get a daily digest of news, comics, trivia, reviews, and more.

Windows Mac iPhone Android. Smarthome Office Security Linux. The Best Tech Newsletter Anywhere Joinsubscribers and get a daily digest of news, geek trivia, and our feature articles. Skip to content. How-To Geek is where you turn when you want experts to explain technology.

Since we launched inour articles have been read more than 1 billion times. Want to know more?This lesson shows you how to retrieve a list of contacts whose data matches all or part of a search string, using the following techniques:.

Note: All the examples in this lesson use a CursorLoader to retrieve data from the Contacts Provider. A CursorLoader runs its query on a thread that's separate from the UI thread. This ensures that the query doesn't slow down UI response times and cause a poor user experience.

For more information, see the Android training class Loading Data in the Background. This technique tries to match a search string to the name of a contact or contacts in the Contact Provider's ContactsContract.

Contacts table. You usually want to display the results in a ListViewto allow the user to choose among the matched contacts. To display the search results in a ListViewyou need a main layout file that defines the entire UI including the ListViewand an item layout file that defines one line of the ListView.

Note: This lesson doesn't describe the UI for getting a search string from the user, because you may want to get the string indirectly. For example, you can give the user an option to search for contacts whose name matches a string in an incoming text message.

The two layout files you've written define a user interface that shows a ListView. The next step is to write code that uses this UI to display a list of contacts.

To display the list of contacts, start by defining a Fragment that's loaded by an Activity. Using a Fragment is a more flexible technique, because you can use one Fragment to display the list and a second Fragment to display the details for a contact that the user chooses from the list. Using this approach, you can combine one of the techniques presented in this lesson with one from the lesson Retrieve details for a contact.

To learn how to use one or more Fragment objects from an an Activityread the training class Build a dynamic UI with Fragments. To help you write queries against the Contacts Provider, the Android framework provides a contracts class called ContactsContractwhich defines useful constants and methods for accessing the provider.

When you use this class, you don't have to define your own constants for content URIs, table names, or columns. To use this class, include the following statement:. Since the code uses a CursorLoader to retrieve data from the provider, you must specify that it implements the loader interface LoaderManager. Also, to help detect which contact the user selects from the list of search results, implement the adapter interface AdapterView. For example:. Note: Since Contacts. Initialize the Fragment.

Add the empty, public constructor required by the Android system, and inflate the Fragment object's UI in the callback method onCreateView.

To get the ListView object that displays the contacts, you need to call Activity. Use the Context of the parent activity when you call setAdapter. When you display the results of a search, you usually want to allow the user to select a single contact for further processing. For example, when the user clicks a contact you can display the contact's address on a map.

To provide this feature, you first defined the current Fragment as the click listener by specifying that the class implements AdapterView. Since you specified that the current Fragment is the OnItemClickListener for the ListViewyou now need to implement its required method onItemClickwhich handles the click event.

This is described in a succeeding section. Define a constant that contains the columns you want to return from your query.The Contacts Provider is a powerful and flexible Android component that manages the device's central repository of data about people.

The Contacts Provider is the source of data you see in the device's contacts application, and you can also access its data in your own application and transfer data between the device and online services.

The provider accommodates a wide range of data sources and tries to manage as much data as possible for each person, with the result that its organization is complex. Because of this, the provider's API includes an extensive set of contract classes and interfaces that facilitate both data retrieval and modification. This guide assumes that you know the basics of Android content providers.

To learn more about Android content providers, read the Content Provider basics guide. The Contacts Provider is an Android content provider component.

It maintains three types of data about a person, each of which corresponds to a table offered by the provider, as illustrated in figure The three tables are commonly referred to by the names of their contract classes. The classes define constants for content URIs, column names, and column values used by the tables:. The other tables represented by contract classes in ContactsContract are auxiliary tables that the Contacts Provider uses to manage its operations or support specific functions in the device's contacts or telephony applications.

A raw contact represents a person's data coming from a single account type and account name. Because the Contacts Provider allows more than one online service as the source of data for a person, the Contacts Provider allows multiple raw contacts for the same person. Multiple raw contacts also allow a user to combine a person's data from more than one account from the same account type. Most of the data for a raw contact isn't stored in the ContactsContract.

RawContacts table. Instead, it's stored in one or more rows in the ContactsContract. Data table. Each data row has a column Data. RawContacts row. The important columns in the ContactsContract. RawContacts table are listed in table 1. Please read the notes that follow after the table:. The following are important notes about the ContactsContract.

RawContacts table:. For example, if you want your app to maintain contacts data for your web-based service with the domain com. You can explain this requirement to the user in documentation, or you can prompt the user to add the type and name, or both. Account types and account names are described in more detail in the next section. Sources of raw contacts data To understand how raw contacts work, consider the user "Emily Dickinson" who has the following three user accounts defined on her device:.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It only takes a minute to sign up. Since I had to revert to 4. Could you please tell me where to find the associated data base for Contacts Storage?

My phone is rooted. And no, my contact data is not on GMail and I honestly don't know why The exact location of the contacts database might depend on your manufacturer's "customization". With this application you can browse the database in a graphical mode.

Of course you also can use the command line sqlite3 client if you prefer. Crucial point to directly access this database is that your device must be rooted -- a precondition you already meet, as your question states.

Android contacts provider directory

So you can either use a file manager to navigate to the database file, and copy it to your computer for investigation -- or directly pull it to your computer via adb pull. A third option would be to investigate it directly on your device, e. If you are rooted, use Titanium Backup to take out contact storage.

Click on it to enlarge. Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Ask Question. Asked 7 years, 3 months ago.

Active 3 years, 9 months ago. Viewed k times. Sebastian Sebastian 1 1 gold badge 3 3 silver badges 6 6 bronze badges. Active Oldest Votes. Here's a screenshot : Click on it to enlarge. Matthew Read Android Quesito Android Quesito Could you explain that in more detail, please? The Overflow Blog. Featured on Meta. New post lock available on meta sites: Policy Lock.

Android contacts provider directory

Feedback post: New moderator reinstatement and appeal process revisions. Linked 0. Related 6. Hot Network Questions. Question feed.


thoughts on “Android contacts provider directory

Leave a Reply

Your email address will not be published. Required fields are marked *