jQuery in Action, 2nd edition*
The moose likes Android and the fly likes Contact API in 1.6 in 2.2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Contact API in 1.6 in 2.2" Watch "Contact API in 1.6 in 2.2" New topic
Author

Contact API in 1.6 in 2.2

Pratik Goswami
Ranch Hand

Joined: Mar 02, 2009
Posts: 136

Hi All,

I am looking for the solution to get contact details (Phone, Email, Zip) from the device. I have implemented code for OS 1.6 as well as for 2.2. I am building an application with API level 4 (1.6), but when I run the build in 2.2 device I am getting email and phone string null.

CODE - for OS 1.6



CODE - for OS 2.2



Here is the code snippet I have found




Do anyone have suggestion how can I get contacts' information with help of this code snippet?


Thanks
Pratik Goswami

iOS * Android Developer
James Elsey
Ranch Hand

Joined: Dec 21, 2007
Posts: 228

IIRC the "People" API is deprecated in 2.2 so you will need to use the ContactsContract provider

I did start to write up my findings on this but I need to review it/complete it, but my post might help you


Kind Regards, James. OCPJP 1.6 || My SCJP / OCJCP Study Notes
Interested in : SCJP, Google App Engine, Stripes, Android;|| My Bite-Size SCJP Study Blog
 
Consider Paul's rocket mass heater.
 
subject: Contact API in 1.6 in 2.2