android-contacts

What exactly contact_last_updated_timestamp flag returns?

柔情痞子 提交于 2020-08-10 04:59:18
问题 I am fetching the contacts which are updated after given time stamp and my code is Uri uri = ContactsContract.Contacts.CONTENT_URI; Cursor cursor = cur = contentResolver.query(uri, null, "contact_last_updated_timestamp > ?", new String[]{timeStamp}, null); But the cursor returns the contacts which are not updated/deleted/added after given timestamp . The problem is cursor is returns some of the contacts from the device's contacts list. It means that there is less chances that the query is

When deleting a contact on android, other random contacts id's being changed

生来就可爱ヽ(ⅴ<●) 提交于 2020-04-30 11:42:25
问题 I am trying to sync user phone numbers to firestore. It seems to work but when i delete a contact from my phone, it seems like some other contacts id's are being replaced, causing unnecessary deletion and creation to firestore. My only clue is that these contacts mostly around id 120,000. Is it normal? What is goung on? This is how i get new created contacts, lcid is the last-contact-id registered to firestore: private fun getNewContacts(): Cursor? { val projection = arrayOf( ContactsContract

Android :Programmatically updated contact is not syncing with other apps

允我心安 提交于 2020-04-30 06:29:11
问题 When a contact is updated with batch operation "context.getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);" then other apps like WhatsApp does not take updates automatically. For example, If mobile number is updated/removed as:- String deviceNumber= "+1 (234) 56789"; String oldTrimmed= "+123456789"; String where = ContactsContract.CommonDataKinds.Phone.NUMBER + " = ? OR " + ContactsContract.CommonDataKinds.Phone.NUMBER + " = ? AND " + ContactsContract.Data.CONTACT_ID + " = ?

Contact fetching takes too much time

落爺英雄遲暮 提交于 2020-01-23 20:44:55
问题 In my code the contact fetching takes too much time to fetch the contacts and show in the application. Please guide me where i am wrong and what should i correct in order to make execution time fast. Here is my code. ContentResolver cr = getContentResolver(); Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null ); String phone = null; List<String> phonenumber = new ArrayList<String>(); String emailContact = null; String emailType = null; String image_uri = "";

Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord in Android Studio

为君一笑 提交于 2020-01-19 07:10:46
问题 I am getting this error when I am trying to read contacts from phone and I included READ_CONTACTS permission in Manifest file. And the strange thing is that it was working fine in Eclipse but when I converted my project to Gradle and run it in Android Studio I'm getting this error. logcat says: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{302f069 29282:com.GP/u0a322} (pid=29282, uid=10322) requires android.permission.READ_CONTACTS or

Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord in Android Studio

半城伤御伤魂 提交于 2020-01-19 07:09:41
问题 I am getting this error when I am trying to read contacts from phone and I included READ_CONTACTS permission in Manifest file. And the strange thing is that it was working fine in Eclipse but when I converted my project to Gradle and run it in Android Studio I'm getting this error. logcat says: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{302f069 29282:com.GP/u0a322} (pid=29282, uid=10322) requires android.permission.READ_CONTACTS or

Contacts provider not appears in “google contacts application”

时光毁灭记忆、已成空白 提交于 2020-01-17 06:41:28
问题 I wrote a Contacts provider. It is quite configurable via "Settings/Accounts", it correctly sync contacts from remote server and these contacts are visible in the "Google contacts" application. But in the setting "Contacts to display" of the "Google Contacts application" I can't see my provider (but I see others, like skype). Platform: Android >= 5.0 Any idea? TIA Roberto C. 回答1: I assume you've created an xml file for you SyncProvider, that xml file has a field userVisible , make sure it's

When I insert a contact, it inserts properly, but I get an “unnamed” entry at the top with no data

和自甴很熟 提交于 2020-01-16 11:23:58
问题 EDIT: I suspect this is resulting from a bug in my HTC sense UI. I would also accept an answer allowing me to test this theory without losing any phone data (i.e. hard reset or otherwise). The phone is an HTC Incredible running Froyo 2.2. I'm trying to insert a large batch of contacts (parsed into an object through XML, but basically from a custom Object) and I'm having the above problem. Contacts are adding just fine (to the "com.google" account), but for each contact added, there is a

How to define ContactsAccountType for a server like Exchange to allow user to edit in native contact app using syncadapters

微笑、不失礼 提交于 2020-01-16 08:59:14
问题 I am implementing SyncAdapter which sync data from Microsoft Exchange server to device native contact. However, exchange have some limitation on the DataKinds e.g only 3 email id allowed of each type Home, Work, Mobile etc. Similarly for other pre-defined MimeTypes. I want the native contact app to honour this while editing/creating a new contact. I have added follow meta-data to my syncadapter.xml <meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contacts"/

Contact picker that shows number, contact name and possibly a contact image?

ぐ巨炮叔叔 提交于 2020-01-14 02:53:05
问题 Is there any way to display contact picker that has both number and contact name? Now I'm calling picker: startActivityForResult( new Intent(Intent.ACTION_PICK,Contacts.Phones.CONTENT_URI), 1); But in a result I get only Contact names without visible numbers. To make things worse, if one contact has two numbers it occurs twice. 回答1: try this. its just like the contact picker, but lists clickable phone numbers under the contacts name Intent intent = new Intent(Intent.ACTION_PICK, Contacts