Retrieve Email Id from contacts

by Deepak » Thu, 19 Jun 2008 13:49:15 GMT


Sponsored Links
 ello All,

Does anyone know how to retrieve email ids from added contacts.

I was able to add email ids programmatically using the following code
snippet below, but I could not retrieve it ! :(

try {
ContentValues person = new ContentValues();
person.put(Contacts.People.NAME, "Smith John,
Mr.");
person.put(Contacts.People.COMPANY, "Test
Company");
person.put(Contacts.People.NOTES, "eNotes");

Uri newPerson =
PhoneBook.this.getContentResolver().insert(
Contacts.People.CONTENT_URI,
person);

if (newPerson != null) {
List pathList =
newPerson.getPathSegments();
String pathLeaf = (String) pathList
.get(pathList.size() -
1);

// add mobile phone number
ContentValues number = new
ContentValues();
number.put(Contacts.Phones.PERSON_ID,
pathLeaf);
number.put(Contacts.Phones.NUMBER,
"(408) 111-1111");
number.put(Contacts.Phones.TYPE,

Contacts.Phones.MOBILE_TYPE);
Uri phoneUpdate =
PhoneBook.this.getContentResolver()

.insert(Contacts.Phones.CONTENT_URI, number);
if (phoneUpdate == null) {
throw new Exception(
"Failed to
insert mobile phone number");
}

// add fax number
number = new ContentValues();
number.put(Contacts.Phones.PERSON_ID,
pathLeaf);
number.put(Contacts.Phones.NUMBER,
"(408) 111-1111-1");
number.put(Contacts.Phones.TYPE,

Contacts.Phones.WORK_FAX_TYPE);
phoneUpdate =
PhoneBook.this.getContentResolver().insert(

Contacts.Phones.CONTENT_URI, number);
if (phoneUpdate == null) {
throw new Exception("Failed to
insert work fax number");
}

// add email
ContentValues email = new
ContentValues();

email.put(Contacts.ContactMethods.PERSON_ID, pathLeaf);
email.put(Contacts.ContactMethods.KIND,

Contacts.ContactMethods.EMAIL_KIND);
email.put(Contacts.ContactMeth



Retrieve Email Id from contacts

by Deepak » Fri, 20 Jun 2008 01:25:16 GMT


 ah ! I actually found the solution ! :)


On Jun 19, 6:48pm, Deepak <[EMAIL PROTECTED]> wrote:
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Retrieve Email Id from contacts

by Kumar app » Fri, 20 Jun 2008 05:55:34 GMT


 ould you please share to the community...


On Fri, Jun 20, 2008 at 6:55 AM, Deepak <[EMAIL PROTECTED]> wrote:



--
--
Adios,
kokki a.k.a Kumar.A.P.P
Http://sapped.wordpress.com

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Can we download somewhere the firmware of the HTC G1 dev edition

Hi,

In order to have a safe working image, i wanna know if there is a place wher i 
can download the firmware of the current HTC G1 dev edition ?

 Regards


Thierry GAYET
NextInnovation.org
+33(0)663.849.589



      
--~--~---------~--~----~------------~-------~--~----~

2. Before to reflash my device how i can backup/extract the actual firmware image ?

Hi,

Before to reflash my device, i wanna know if i can backup/extract the actual 
firmware image (may i) ?

 Regards


Thierry GAYET
NextInnovation.org
+33(0)663.849.589



      
--~--~---------~--~----~------------~-------~--~----~

3. tabhost disappearing randomly

4. Method for flashing a device HTC G1 dev edition

5. DEVICE_POWER permission denied for using goToSleep

6. Kill a background thread onStop()?

7. What is the problem with my android: Unable to extract+optimize DEX from '/system/framework/ext.jar'