contactscontract

Android: set contact photo with ContactsContract insert intent

瘦欲@ 提交于 2019-12-13 12:40:23
问题 I am using ContactsContract to insert a new contact by sending the user to a "New contact" intent. The code I am using is: Intent i = new Intent(Intent.ACTION_INSERT); i.setType(Contacts.CONTENT_TYPE); i.putExtra(Insert.NAME, "Some Contact Name"); i.putExtra(Insert.EMAIL, "address@email.com"); i.putExtra(Insert.PHONE, "123-456-7890"); startActivity(i); However, I need to also somehow pass in a locally stored photo (in res/drawable) to show up on this "New contact" intent. I was hoping that

show List of all contacts with phonenumber in android? [duplicate]

夙愿已清 提交于 2019-12-13 09:40:49
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to read contacts on Android 2.0 Is it possible to create a List of my all Contacts with PhoneNumber in phone book , but condition is if it don't have PhoneNumber then it shows only name for that record. I want all this in my android application.I have stuck with this. 回答1: By this way you found all contact name that have no contact number. while (cur.moveToNext()) { String id = cur.getString(cur

How to get Contact Information in Android?

别等时光非礼了梦想. 提交于 2019-12-13 06:16:09
问题 I want to get Contact Image, Name, Number from my mobile using android. im using ContactsContract to fetch these information. but i can't. can anyone know the exact tutorial for learning. i want to list these info in a custom listview. Thanks in Advance. i hope your valuable guiding will help me. PS: In the DB i have my friends number. i want to synchronize the phone contact and the DB contact using the matched phone no. and i need to display all the matched contacts in the listview. the

read/parse only Mobile numbers from android's phonebook (ContactsContract.Contacts)

被刻印的时光 ゝ 提交于 2019-12-13 01:54:13
问题 How to get all the real mobile numbers from androids phone book? I used ContactsContract.Contacts and created respective cursors. while it's working fine, I am stuckup with only fetching VALID MOBILE NUMBERS We can use ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE to filter Mobile Numbers, but we can also save valid mobile numbers into other fields like ContactsContract.CommonDataKinds.Phone.TYPE_HOME and vice versa String phoneNumber = null; String email = null; Uri CONTENT_URI =

Android. Open the device's Contact list with an Intent not working. Unable to instantiate activity ComponentInfo

点点圈 提交于 2019-12-13 01:43:30
问题 This is an experiment for understanding what ContactsContract can offer. I don't know what I've done wrong... Please help me with this problem. My code: package com.example.beni.contactbrowser1; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; import android.view.Menu; import android.view.MenuItem; import

android contacts sync without auth token

落花浮王杯 提交于 2019-12-13 00:13:35
问题 Is there a way to sync android contacts with server without using authToken, just username and password? How can it be done? I want to authenticate with username and password everytime i sync the contacts, without using the authToken at all. Let's say on the SampleSyncAdapter , what should I change to achieve this. 回答1: You can use the account name as the user name, and save the password either as the token as or additional info. In the SampleSyncAdapter, just replace what your sending to the

Empty Cursor when querying contact uri

本小妞迷上赌 提交于 2019-12-12 17:26:34
问题 My little test app picks one contact using the contact picker: final Intent contactPickerIntent = new Intent(Intent.ACTION_PICK, android.provider.ContactsContract.CommonDataKinds.Phone.CONTENT_URI); startActivityForResult(contactPickerIntent, PICK_CONTACT); in the onActivityResult method, I parse the result and it's something like content://com.android.contacts/data/7557 . I then query this uri to get its name and lookup key: final String[] projection = new String[] { ContactsContract

How to use the contact pictures synced by Facebook for Android

删除回忆录丶 提交于 2019-12-12 09:04:40
问题 I'm having Facebook for Android on my phone which automatically synces the FB profile pictures of the people in my contact list to my phone. I'd like to use those pictures within my app where I access ContactsContract.PhoneLookup . Do I really need the Facebook SDK to do that? I guess not, but I cannot find any evidence of the pictures being saved somewhere around ContactsContract 回答1: You simply need to query for the Photo URI and use the URI as per your needs. This method will help you /**

Android How to read android Contacts and SIM Contacts?

拜拜、爱过 提交于 2019-12-12 03:39:12
问题 I am currently getting read only android contacts, below is the code I'm using: String[] projecao = new String[] { Contacts._ID, Contacts.LOOKUP_KEY, Contacts.DISPLAY_NAME }; String selecao = Contacts.HAS_PHONE_NUMBER + " = 1"; Cursor contatos = contexto.getContentResolver().query( ContactsContract.Contacts.CONTENT_URI, projecao, selecao, null, null); And to get Phone Number: Cursor phones = contexto.getContentResolver().query( Phone.CONTENT_URI, new String[] { Phone.NUMBER }, Phone.CONTACT

Best way to access all the details of android contacts

99封情书 提交于 2019-12-11 23:22:34
问题 I am writing an application to sync contact details with my server. For this I need to query Contacts using content provider multiple times as all the data is not present in one table. For example by using contact id, I have to query separately to phone, email and address tables for each contact which I feel is not much efficient. It would be really helpful if someone could point me out ways to get all the contact details in a single query. Thanks in advance :) 回答1: If you have the