[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-12-17 Thread DulcetTone
Mark, did you finish this and post it somewhere? How do I look for it? I am enjoying my warescription, by the way. I will look for a feedback link on your site, as I have some. tone On Nov 26, 7:42 am, Mark Murphy mmur...@commonsware.com wrote: This is a fragment of a sample that I'll be

[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-12-17 Thread DulcetTone
oops... did a little looking. I guess you're going to be commonsguy. tone -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to

[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread axel
Back to the original question: Apps working well with 1.5/1.6 are broken with 2.0 - exactly the same problem I have. AFAIK the code below is perfectly valid and should continue to work with 2.0 - unfortunately it does not. String[] returnColumns = new String[] {

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread Mark Murphy
axel wrote: Back to the original question: Apps working well with 1.5/1.6 are broken with 2.0 - exactly the same problem I have. AFAIK the code below is perfectly valid and should continue to work with 2.0 - unfortunately it does not. String[] returnColumns = new String[] {

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread Tim Jowers
Is there an API to determine the phone's version of Android? For now, I'm using try-catch. Sucky but works. Also, my 2.0 built APK does not run on my G1 phone. Maybe it's something I've done but I haven't dug into it. Maybe that's what you meant by intelligent class loading do you mean

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread Mark Murphy
Tim Jowers wrote: Is there an API to determine the phone's version of Android? For now, I'm using try-catch. Sucky but works. android.os.Build.VERSION.SDK. Or, if you're only worrying about 1.6 and newer, use SDK_INT instead of SDK. Also, my 2.0 built APK does not run on my G1 phone. Maybe

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread Tim Jowers
Sweet! Mark. Thanks for covering this. I don't see it solved anywhere on the Net or developer.android.com. Tim On Thu, Nov 26, 2009 at 7:42 AM, Mark Murphy mmur...@commonsware.com wrote: Tim Jowers wrote: Is there an API to determine the phone's version of Android? For now, I'm using

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread Mark Murphy
Tim Jowers wrote: Sweet! Mark. Thanks for covering this. I don't see it solved anywhere on the Net or developer.android.com. A lot of this has been covered on this list before, either in the context of ContactsContract or more generally in the line of supporting different Android API versions.

[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread axel
You will need to use reflection (or intelligent class loading) and use the ContactsContracts provider when running on Android 2.0, allowing your existing Contacts code to be used on 1.5/1.6. The Contacts.ContactMethods API is deprecated but not dropped. And even deprecated APIs are required to

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-26 Thread Tim Jowers
I agree with you Axel, I got it working. But shouldn't have had to do so. The larger moose is version compatibility. The industry standard is two versions back the API should work. Apache does not honor this. Now, Google is not either. It is PAINFUL to partner. In my case, 10 hours plus future

[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-23 Thread Padma
Rachel: My understanding is that the contact Id in the Phone/Email table actually refers to the _ID in the ContactsContract.RawContacts table. You might want to first get the list of all Raw Contacts associated with the particular contact id and then query the Phone table based on the RawContact

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-23 Thread Rachel Blackman
On Nov 20, 2009, at 6:09 PM, Padma wrote: Rachel: My understanding is that the contact Id in the Phone/Email table actually refers to the _ID in the ContactsContract.RawContacts table. You might want to first get the list of all Raw Contacts associated with the particular contact id and

[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-20 Thread Henry
Rachel: Your following query is working perfectly for a single contact. Cursor emails = getContentResolver().query( ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, ContactsContract.CommonDataKinds.Email.CONTACT_ID + = + contactId,

Re: [android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-20 Thread Rachel Blackman
On Nov 20, 2009, at 6:55 AM, Henry wrote: Now, it always return just one row. I tried several ways, like ContactsContract.CommonDataKinds.Email.CONTACT_ID + in ('1', '2', '3'); It always one row. If I just contact id 3, it will return contact 3. Do you know a way to get all the emails

[android-developers] Re: How to get all contact's name phone number, email for 2.0

2009-11-19 Thread Henry
Really appreciated!!! I tried and worked. Here is the original query I used for 1.6: String[] PROJECTS = new String[] { People._ID, People.DISPLAY_NAME, People.NAME, People.NUMBER, People.PRIMARY_EMAIL_ID }; Cursor cursor =