Questions tagged [contactscontract]

Android's Contacts API is defined in the android.provider.ContactsContract and related classes.

The Android platform provides a Contacts API for managing and integrating contacts from multiple accounts and from other data sources.

To handle overlapping data from multiple sources, the contacts content provider aggregates similar contacts and presents them to users as a single entity.

ContactsContract defines an extensible database of contact-related information. Contact information is stored in a three-tier data model: Contacts, Raw Contacts and Data.

More information can be found in the documentation for the ContactsContract class.

551 questions
0
votes
0 answers

How to pick only one contact in android

I want to pick only one contact in my app. But the problem is when I select a contact, it will selected all contact I have. Please review my code. Here is the code: btnContact.setOnClickListener(new View.OnClickListener() { …
Semar
  • 1
  • 1
0
votes
2 answers

How to get email from internal contacts in android?

I am developing an app where i need to get contacts & emails from internal phone book.. After some search in google i found the following code for getting phonenum & name. Main.java Cursor numcur =…
user1578518
0
votes
1 answer

Getting every field from Android's Contact Provider (not just filling a ListView)

I have the following DTO object that represents a contact: public class ContactDTO { private String name; private String eMail; public ContactDTO(String name, String eMail){ this.name = name; this.eMail = eMail; } …
svprdga
  • 2,171
  • 1
  • 28
  • 51
0
votes
1 answer

How to find out which application is accessing phone contacts in background?

I have searched a lot but didn't find any thing useful. I have created one sample application which will read and write the contacts and check the Android Log but didn't found any intent or any thing which shows my contacts are getting accessed by…
0
votes
1 answer

ContactsContract editor ignores email, phone intent data

(code segment revised - now working) According to the Android references http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert.html it should be possible to pass an array of emails and phone numbers to the contact…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
0
votes
4 answers

How to read android.R.id.text2 in android?

I have this following code public class Contacts extends ListActivity { ListView lv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Cursor cursor =…
Ahmed S. Durrani
  • 1,535
  • 2
  • 17
  • 41
0
votes
1 answer

Inserting Contacts in Android

I am developing a backup application for Android, mainly contacts and SMS messages. Backing up isn't a problem, but writing the contacts back to the Android database is proving problematic. This is what I have so…
bren
  • 3
  • 2
0
votes
0 answers

Trying to Edit a contact on Android

I'm trying to send the user to the native contacts application so that they can edit the contact in there, it's working fine in V3.0+ But in a device with 2.3.3 it's giving me an exception, can someone explain me what might be happening? The code is…
albertosh
  • 2,416
  • 7
  • 25
  • 32
0
votes
1 answer

Add contacts in Android 4.2 not notifying app

I'm working on adding contact picker functionality to app, as well as the ability to add a contact from the app into the native contact manager. For inserting, I'm launching the contact manager like so: Intent intent = new…
TaylorP
  • 1,039
  • 2
  • 13
  • 28
0
votes
1 answer

ContactsContract returning phone number with a space that can't be trimmed

I've a weird problem here. When you use this: ContactsContract.CommonDataKinds.Phone.NUMBER It returns 0123 4567890 (or something like that). Now the SPACE in between these numbers is causing issues in a webservice so I was asked to trim it. I…
Asim
  • 6,962
  • 8
  • 38
  • 61
0
votes
0 answers

Android Contacts provider account interfering with other accounts

I've build a contacts provider which is synchronizing contacts from our private server. Everything is working fine until I delete the account. This is where the problem occurs. For example: If from my contacts provider account there is a contact…
0
votes
0 answers

Android App, open contacts list and display phone number

I'm developing an Android app using "android.permission.SEND_SMS" to opne contact list and display it. My app run just fine, but when I pick a contact from my list it only display the first contact phone number for any contact I pick. This is my…
user1661865
  • 75
  • 1
  • 3
  • 5
0
votes
0 answers

Get contact id when click in context menu

I have a list View with some clients. In this listView i click in a client and appear a contextMenu. How i can get the id of the contact that this client have in contactscontract????? public boolean onContextItemSelected(MenuItem item){ …
0
votes
1 answer

How to programmatically add contact that is synced with google

In my application that I'm building I can add contacts to my native contacts list. But the contacts I'm adding are phone-only. How can I programmatically add contact that will be synced with Google account, or even better to ask me if I want the…
0
votes
0 answers

ContactsContract returning this string content://com.android.contacts/data/1 not the phone number from contact list

I copy the code example from the from Beginning Android™ Application Development Book. The code is use to display the contact list according to phone number on my app as user click the button. The code works fine as I comment the //…
ZUBAir hashmi
  • 77
  • 1
  • 6