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
1 answer

Finding city, country, postal code of contact selected from address book

I have seen many threads for accessing contacts from address book, but apart from name and number, i want to access other details like- city, state, country, postal code of the person. I have tried this code, but other things are null. …
amit singh
  • 1,407
  • 2
  • 16
  • 25
0
votes
2 answers

Error inserting account_id=2 contact_id=null _id=824 starred=1 - Batch Adding Contacts - Android

I'm trying to add contacts to the contact list in a batch. I can do it successfully except when I add the Starred field to the batch list. So the problem must be there. Here is my ArrayList code for the Starred field. if(starred == true) { …
dazito
  • 7,740
  • 15
  • 75
  • 117
0
votes
1 answer

Batch / bulk delete contacts - Taking way to long

I'm developing a REST application to delete contacts (and I mean Contacts, not Raw Contacts) in bulk. It is taking me more than 3 minutes to delete a batch of ~116 contacts, it's way to much in my opinion. Sometimes it prints Contacts deleted but…
dazito
  • 7,740
  • 15
  • 75
  • 117
0
votes
1 answer

Loading of activity is very slow

Hi I am developing an android SMS app. I hav an activity which loads the contacts into mPeopleList ArrayList as in below code which is called in doInBackground public void PopulatePeopleList() { mPeopleList.clear(); Cursor people =…
sanjana
  • 641
  • 2
  • 15
  • 36
0
votes
1 answer

Bad request for field slot 0,-1. numRows = 164, numColumns = 63

Hi I am trying to get data from Contacts Table through contentprovider but it Crashes every time when I started my app, Here is my source code: public class WebpreneurActivity extends ListActivity { private DBHandler dbHelper; …
Shazar
  • 103
  • 4
  • 19
0
votes
1 answer

Getting SQLITE Exception in getting data from ContactsContract table

I am trying get all of my contacts from the ContactsConstract table through a ContentProvider in a query and save it to my own SQLite database, but I encountered a SQLiteException in getting this. At start I just wrote a query for getting data from…
Shazar
  • 103
  • 4
  • 19
0
votes
1 answer

Getting all contacts with at least one eMail-Address (DISTINCT)

I'm writing a ContactPickerDialog for a custom Preference. Depending on the preference the ContactPickerDialog should show all contacts with at least one phone number or all contacts with at least one eMail-address. No contact should be shown twice,…
user1567896
  • 2,398
  • 2
  • 26
  • 43
0
votes
1 answer

Query to the ContactsContract database comparing empty fields with empty strings - Android

I'm creating methods to edit a contact's field. Before editing I'm making sure that those fields do exist and correspond to the company I want to edit, so I make a select and look for if(cursor.moveToFirst()) but it is not going inside the if for…
0
votes
1 answer

Get all contact data in Android - multiple URI

I'm tring to get all the contact data at one. I need : * First name * Last name * Phone numberS * Version etc. for that i'm doing a query on the whole contacts and then, for each contact id, i get the relevant data. the problem is that it takes a…
Shahar
  • 3,692
  • 4
  • 25
  • 47
0
votes
0 answers

Getting only the selected contact from ContactsContract

I'm trying to develop an android app at the moment. Right now I want to get the phone number of a selected contact. I enter my contact list with ContactsContract, and I also get the data of a contact by the Cursor object I use. My Problem is I get…
Froxx
  • 957
  • 4
  • 14
  • 27
0
votes
1 answer

Adding field programatically to contact in android devices not working on android 4.3

I am developing an android app that adds fields to some contact that is in the android's data base. Through the app I can delete fields, too. I tested the application on some devices and the fields I add or delete with the application are…
0
votes
1 answer

Selecting/Joining tables from contacts table but get no ouput - Android

I'm trying to go over all contacts using the contacts, raw_contacts and data tables. From reading online I believe that Contacts._id is connected with RawContacts.contact_id and Data.raw_contact_id is connected with RowContacts._id. Am I…
dazito
  • 7,740
  • 15
  • 75
  • 117
0
votes
1 answer

Android Contacts Fields

I want to have all of the contact's fields but i don't know which class of Contacts Contract do that. By this code i receive email address: Cursor email = getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, null,…
Elham Gdz
  • 1,015
  • 3
  • 15
  • 31
0
votes
1 answer

What's the non-deprecated way to invoke Android's Contact List?

This question hasn't been answered since they deprecated the Contacts.People type, and all the answers I could find still involve its use. How can it be done without using People.NAME and People.NUMBER? In other words, I already know that you can…
0
votes
1 answer

Could not save Contact from app

I have an Activity from which I am trying to save the contact using data provided by the user.I find that the Uri returned is null...I have tested some of the code without allowing null values elsewhere and it works...but here it does not seem to be…