Questions tagged [rawcontacts]

39 questions
1
vote
1 answer

Android: imported contacts are not visible

I'm using Adnroid dev SimpleSyncAdapter example to import cloud-based contacts into my application. The import runs fine, when I access contracts2.db in the emulator all contacts are there and raw_contacts, data and contacts tables seem to be…
Bostone
  • 36,858
  • 39
  • 167
  • 227
1
vote
0 answers

Getting Cursor IndexOutOfBound Exception when passing contact-id to fetch details from Contacts

I am getting contact details of a person according to the account name which is working fine but i get the exception for those contacts which have name but not numbers. I am also getting the contact ids for those but when i fetch the details using…
1
vote
1 answer

Save Contacts as "Phone contact"

Is there way to programmatically adds the contact to the internal phone contacts book as a "phone contact"? I've tried: list.add(ContentProviderOperation .newInsert(ContactsContract.RawContacts.CONTENT_URI) …
Siarhei
  • 2,358
  • 3
  • 27
  • 63
1
vote
0 answers

RawContacts DELETED flag not set

When we delete a contact from contact manager it set the RawContacts DELETED flag to "1". In emulator when I delete a phone contact it is showing DELETED flag "1", but when I delete a phone contact from Samsung device it is showing that flag…
Amrat Singh
  • 331
  • 2
  • 13
1
vote
1 answer

ContentProvider (contacts) - no such column: metadata_dirty

I'm trying to get all contacts of a specific type from the phone like following: Cursor cursor = context.getContentResolver().query( ContactsContract.RawContacts.CONTENT_URI, null, …
1
vote
0 answers

What is the use case for RawContact DATA_SET?

According to Android documentation (ContactsContract.RawContacts), the DATA_SET column provides another degree of uniqueness. The data set within the account that this row belongs to. This allows multiple sync adapters for the same account type…
Peri Hartman
  • 19,314
  • 18
  • 55
  • 101
1
vote
1 answer

How can I sort RawContacts by their display name?

I need to read all contacts that belong to a specific account and sort them by their name. And I would like to get them sorted in the Cursor rather then sort them after in an array. This is what I currently do: I make a query in…
DoruChidean
  • 7,941
  • 1
  • 29
  • 33
1
vote
1 answer

How to get rawcontact id with contact id and lookup key

I am trying to get rawcontacts._ID from contacts provider by using the lookup key and contact id stored in the application. This function exists that might help me but I am not sure how to construct the rawContactUri public static Uri…
androiduae
  • 153
  • 2
  • 9
1
vote
2 answers

How to set default image to Android phone contact that has no previous image

I have a piece of code which updates the an Android contact´s image, the problem is that it doesn't work when the contact has no previous image. I also checked that the contact was from "Phone" account or "*@gmail.com" account. When it already has…
1
vote
0 answers

Change of ContactsContract.RawContacts _ID after aggregation

According to Google docs, you should use LOOKUP_KEY to fetch a contact, since its ID in the ContactsContract.Contacts table can change: An opaque value that contains hints on how to find the contact if its row id changed as a result of a sync or…
Joel
  • 5,949
  • 12
  • 42
  • 58
1
vote
1 answer

Get RawContact photo

I know it is possible to get the contact's photo using something like: public InputStream getContactPhotoInputStream() throws IOException { Uri uri = Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_URI, String.valueOf(mContactId)); …
dazito
  • 7,740
  • 15
  • 75
  • 117
1
vote
2 answers

Deleting a specific RawContact content directory entry

I'm new to android dev, so I may get the whole concept totally wrong. I want to delete a specific entry from RawContact directory entry. Here is code that I have: Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI,…
Nikolay R
  • 957
  • 2
  • 11
  • 22
1
vote
1 answer

Retrieving all Contacts that have a specific Account attached to them

I am making a communication app that has been set up with a specific Account type in the AccountManager and has a SyncAdapter attached to it. Several of my contacts have a RawContact which has a MIMETYPE of my new account and some associated data. I…
Glenn.nz
  • 2,261
  • 2
  • 17
  • 20
1
vote
2 answers

how to add an existing contact to the "Phone contacts" Account

iam adding a contact to the device using this code long Contact_Id = 100; ContentValues pCV =new ContentValues(); pCV.put(Contacts.People.NAME, "test"); pCV.put(ContactsContract.Contacts._ID, Contact_Id); Uri newContactUri =…
AnasBakez
  • 1,230
  • 4
  • 20
  • 36
0
votes
1 answer

Problems in adding data to ContactsContract.CommonDataKinds.StructuredName

I am trying to add Contact data in StructuredName with the following code. The problem is GIVEN_NAME is added but other fields are not added. ops.add(ContentProviderOperation .newInsert(ContactsContract.Data.CONTENT_URI) …