android - Writing SQLite statement to retrieve all contacts information -


After the

I need to write a SQLite statement to retrieve all HAS_PHONE_NUMBER columns and _ Id to contact table (where all phone contacts reside).

I hope this will look something like this:

Do I contact HAS_PHONE_NUMBER, _ID

from me in fact Code is required, where I can get the record from the Android Phonebook (an array or list through the above statement)

like this:

  if (integer parseInt (cur.getString (cur.getColumnIndex (ContactsContract.Contacts.HAS_PHONE_NUMBER))) gt; {cursor pCur = cr .query (ContactsContract.CommonDataKinds.Phone.CONTENT_URI, Null, ContactsContract.CommonDataKinds.Ph One.CONTACT_ID + "=?", New string [] {id}, tap); While (pCur.moveToNext ()) {// Do something with the phone} pCur.close (); }  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -