When I fetch CURSOR for SIM CONTACTS, it gives me 5 columns fields which are name, number, extra_number, emails and _id.
So it is actually not providing us the field for "type of contact number" similar to mime-type field like phone contacts.
Might be it possible, if yes please, if someone else can complete this.
I have posted my code which I am using in my application.
try{ String m_simPhonename = null; String m_simphoneNo = null;
Uri simUri = Uri.parse("content://icc/adn");
Cursor cursorSim = this.getContentResolver().query(simUri,null,null,null,null);
Log.i("PhoneContact", "total: "+cursorSim.getCount());
while (cursorSim.moveToNext())
{
m_simPhonename =cursorSim.getString(cursorSim.getColumnIndex("name"));
m_simphoneNo = cursorSim.getString(cursorSim.getColumnIndex("number"));
m_simphoneNo.replaceAll("\\D","");
m_simphoneNo.replaceAll("&", "");
m_simPhonename=m_simPhonename.replace("|","");
Log.i("PhoneContact", "name: "+m_simPhonename+" phone: "+m_simphoneNo);
if(m_simphoneNo.length()>0){
if(m_simPhonename!=null){
}else{
m_simPhonename = m_simphoneNo;
}
callbackDB.InsertContacts(null, m_simPhonename+"="+m_simphoneNo, m_simphoneNo, null);
}
}
}
catch(Exception e)
{
e.printStackTrace();
}