1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| private String IMEI = null;
private String SIM = null;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Thread checkUser = new Thread(new Runnable() {
public void run() {
try {
TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
IMEI = tm.getDeviceId();
SIM = tm.getSimSerialNumber();
if (IMEI == null)
Log.i("NOTE", "IMEI nul");
else
Log.i("NOTE", "IMEI non nul");
} catch (Throwable t) {
Log.e("NOTE", "Runnable impossible " + t.toString());
}
checkUser.start();
} |