我一直在尝试从 sim 卡读/写,但仍然没有运气。
到目前为止,这是我的代码:
//read from sim
public String adding() {
Uri simUri = Uri.parse("content://icc/adn/");
Cursor cursorSim = this.getContentResolver().query(simUri, null, null,null, null);
String b = "";
while (cursorSim.moveToNext()) {
b+= (cursorSim.getString(cursorSim.getColumnIndex("name")));
b += "\n" + (cursorSim.getString(cursorSim.getColumnIndex("_id")));
b+= "\n" + (cursorSim.getString(cursorSim.getColumnIndex("number")));
}
return b;
}
//写入sim
public void testing4() {
ContentValues values = new ContentValues();
values.put( "tag", "test" );
values.put( "number", "1234" );
getContentResolver().insert( Uri.parse("content://icc/adn/"); , values
);
}
如果您对此有所了解,请告诉我。
谢谢