3

Is there a way to read "raw" data of a Sim card? Similar to how to read a raw data with a SmsMessage raw data which is the Pdu?

quarks
  • 33,478
  • 73
  • 290
  • 513
  • What "raw data" do you want to get from the SIM card? Please specify – Zerhinne Feb 07 '12 at 03:33
  • Pdu is a byte[] array, so there should be a way to get a byte[] array of a Sim card data on a given Android phone, or a Hex String data. This is what I mean by raw data. Something that I can parse to get the fields. – quarks Feb 07 '12 at 03:55

2 Answers2

6

For reading SIM card related information you need TelephonyManager API.

TelephonyManager mTelephonyMgr = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
String imei = mTelephonyMgr.getDeviceId();

The TelephonyManager API's method contains lots of other information like MNC,MCC, SimOperator's Name, Cell Location etc.

Lucifer
  • 29,392
  • 25
  • 90
  • 143
0

....These restrictions are implemented in a variety of different forms. Some capabilities are restricted by an intentional lack of APIs to the sensitive functionality (e.g. there is no Android API for directly manipulating the SIM card)... source : android permission model