public List ReadAllSimContact()
{
List list = new List();
list.Initialize();
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("|","");
list.add(m_simPhonename +","+m_simphoneNo);
Log.i("PhoneContact", "name: "+m_simPhonename+" phone: "+m_simphoneNo);
}
}
catch(Exception e)
{
e.printStackTrace();
}
cursorSim.close;
return list;
}