this prog is working for me
i think this will help u ....
import android.app.Activity;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
public class GetSimActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button tmpbtn = (Button) findViewById(R.id.button1);
tmpbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
// TODO Auto-generated method stub
TelephonyManager telMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
Toast toast = Toast.makeText(getApplicationContext(), "Mobile Number : "+ telMgr.getLine1Number(), Toast.LENGTH_SHORT);
toast.show();
toast = Toast.makeText(getApplicationContext(), "Sim Serial Number : "+ telMgr.getSimSerialNumber(), Toast.LENGTH_LONG);
toast.show();
}
});
}
}
Also u have to add permission in manifest
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>