Q:

how to get email id of the person which are in my contact list in Android

I just want to get email id of user having phone number given.
so i have to get email id of user whose number is like 986879899.so plz suggest me the solution of this problem or any links from where i got the solution.
I want to add one more thing that how to get person contact no. from my phone by referring  person name who is in my contact list.

A:

    This is the solution of the above problem. Ashutosh given me the solution of the problem.

Cursor emails = getContentResolver().query(ContactsContract.CommonDataKinds.Email.CONTENT_URI, null, ContactsContract.CommonDataKinds.Email.CONTACT_ID + " = " + contactId, null, null); 
       while (emails.moveToNext()) { 
          // This would allow you get several email addresses 
          String emailAddress = emails.getString( 
          emails.getColumnIndex(ContactsContract.CommonDataKinds.Email.DATA)); 
       System.out.println("email address might be"+emailAddress);
       } 
       emails.close();

        Thanks Ashutosh :)

