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. problem in also porting to android in beagle

hi,

i am porting android to beagle. i applied the alsa patch. still the error is
coming.

Target StaticLib: libasound (out/target/product/generic/obj/
STATIC_LIBRARIES/libasound_intermediates/libasound.a)
target SharedLib: libaudio (out/target/product/generic/obj/
SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so)
out/target/product/generic/obj/SHARED_LIBRARIES/libaudio_intermediates/
AudioHardwareALSA.o: In function `android::AudioStreamOutALSA::standby
()':
hardware/alsa_sound/AudioHardwareALSA.cpp:906: undefined reference to
`release_wake_lock'
out/target/product/generic/obj/SHARED_LIBRARIES/libaudio_intermediates/
AudioHardwareALSA.o: In function `android::AudioStreamOutALSA::write
(void const*, unsigned int)':
hardware/alsa_sound/AudioHardwareALSA.cpp:831: undefined reference to
`acquire_wake_lock'
collect2: ld returned 1 exit status
make: *** [out/target/product/generic/obj/SHARED_LIBRARIES/
libaudio_intermediates/LINKED/libaudio.so] Error 1


how to solve this, i am unable to make any progress after this.

HarishKumar.V

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Populating a listadapter

Hi,

I've built an application that loads XML from a server, then creates a list
of items and with that I create and adapter that I set with

setListAdapter(my adapter);

The problem I'm having now is that creating the list and adapter takes time,
so I was thinking on creating just like 20 entries and populate the list,
then create the rest on runs background or maybe when the person gets to the
bottom (like gmail application).

Is there any tutorial or demo with this somewhere to see a good way to do
this?

Thanks.

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

3. Sending info via Handler

4. ******New Model Android Phone for sale******

5. alsa-lib error during porting android to beagle

6. GSMA a disappointment for Android Developers

7. docs/reference/keywords.html