private Cursor getContacts()
{
// Run query
Uri uri = ContactsContract.Contacts.CONTENT_URI;
String[] projection = new String[] {
ContactsContract.Contacts._ID,
ContactsContract.Contacts.DISPLAY_NAME
};
String selection = ContactsContract.Contacts.IN_VISIBLE_GROU...
I'm having trouble loading a photo for a contact in Android. I've googled for an answer, but so far have come up empty. Does anyone have an example of querying for a Contact, then loading the Photo?
So, given a contactUri which comes from an Activity result called using
startActivityForResult(new Intent(Intent.ACTION_PICK,ContactsCont...
hi im trying to call the contact picker, get the persons name, phone and e-mail into strings and send them to another activity using an intent. So far this works
Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
startActivityForResult(intent, 1);
@Override
public void onActivityResult(in...
I would like to insert a new raw contact. I'm sure this involve some sort of getContentProvider().insert using a ContactsContract uri of some sort. Can anyone show an example using a ContentValues to to insert a brand new contact?
(Update)
There is an excellent example in the SDK
http://developer.android.com/resources/samples/ContactMa...
Hi all,
I'm using the following piece of codes to create a new contact. It follow closely the ContactManager example provided by Android.
The problem is, the created contacts do not appear in the Contacts app that shipped with Android. Nevertheless, when I load all the contacts from the phonebook, I can see the newly created contacts....
I have the following piece of code in my Android application that looks up a contacts ID, I have just changed the target from 1.5 to 2.2 but with a min SDK of 3 (1.5) so that I can use the ContactsContract Uri in 2.2 and the People Uri in 1.5.
However the code leads to the following error when run on 1.5 devices:
07-27 15:02:53.382: WA...
I'm able to add a Contact with ContactsContract to one of the user's accounts (a difficult feat in itself!), but I still haven't been able to add it to a group that will show up. I know that the user can go to their contact options and check a "Show All (Other) Contacts" box in their account, but not only is this is an extra step for the...
I am trying to get the contact's phone number after I have retrieved their ID number from the built-in activity. However, whenever I query the database using the cursor in my code below -- I get zero rows returned even though there is a mobile number for the contact I have selected.
Can anyone point me in a better direction or show an ...
I am trying to do a Contacts search on Android using ContactsContract.
I would like to search on multiple parameters, e.g. - Where name = myname AND email = myemail AND nickname = mynickname, etc.
I have it working w/ just name, but need the syntax to add email and nickname as search params. I know they are stored separately from disp...
I've read related several questions here and can't find the answer to this: I have an Android 2.1 device (HTC Incredible). My app, however, must be compatible with early (pre SDK 5) devices, so I am using the deprecated format of filter URI:
Uri contactUri = Uri.withAppendedPath(Contacts.Phones.CONTENT_FILTER_URL, Uri.encode(number));
C...
Hi guys,
I am trying to write a method that determines if a contact has at least one phone number, at the moment I have this:
public boolean hasPhone() {
Cursor phones = this.map.getContentResolver().query(
ContactsContract.Contacts.CONTENT_URI,
null,
ContactsContract.Contacts._ID + "=" + this.contactId,
null,
null
);
bool...
If you want to obtain contacts data from two separate URIs, can you do this in a single query?
For example :
ContentResolver cr;
Cursor emailCur = cr.query(
ContactsContract.CommonDataKinds.Email.CONTENT_URI,
null,
null,
null);
Should return all available columns ag...
Hi
I am using ContactsContract api intent for showing all contacts from an activity. This intent returns an id of the contact. I need to get the postal address of this contact.
Here is the code which i am using for showing contacts:
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType(ContactsContract.Contacts.CONTENT_TYP...
Alas I have about 500 contacts in my phone book and for some reason after synch'ing them with thunderbird the display name is random last, first...first last. So I thought I would put a quick widget together to just re-do al my display names to last, first. The code I use is below, however I am not getting last / first values. The key...
When adding a contact in the new android contacts API, can I use newAssertQuery() also for insert, or will it only update an existing entry. If so, what is the difference between newAssertQuery() and newUpdate()?
More generally, do I need to check whether a raw contact or data exist first and then either insert or update, or is there a ...
Hi stackies,
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 o...
My problem defn is :
1.on clicking a button go to Contacts of android
2.select a contact
3.the next screen shud show the details of that contact..that is diff phone nos, emails etc
4.i shud be able to select either a particular phone no or an email. and return that info
how can i implement that as starActivityForResult() is not allowing...
If you try the Contact Manager that comes with Android 2.2 Froyo it will give you access to all contacts in the sqlite database via Contact ContentProvider. But if you write an app that is not
com.android.contacts you only get access to the restricted table because of this code here:
http://www.google.com/codesearch/p?hl=en#cbQwy62oRI...
I've been using the ContactsContract api for some time now and I've come across two "columns" listed in the API page for ContactsContract.Contacts that do not appear to actually be assessable.
The values are (under the columns heading):
"NAME_RAW_CONTACT_ID" and "DISPLAY_NAME_PRIMARY"
By my reading of the API these two values would see...
Hello,
using the API I am trying to create a contact, using the API 2.x and not the old one. Here http://developer.android.com/guide/topics/providers/content-providers.html it only explains the old API. I haven't found any proper tutorial, example, etc. showing how to create a contact. As far as I have figured out I have to create a raw...