直接来代码:
权限:<uses-permission android:name="android.permission.READ_PHONE_STATE" /> //获取手机号码
代码:
TelephonyManager tm = (TelephonyManager) this.getSystemService(Context.TELEPHONY_SERVICE); String deviceid = tm.getDeviceId(); String tel = tm.getLine1Number();//手机号码 String imei = tm.getSimSerialNumber(); String imsi = tm.getSubscriberId();
这样就拿到很多东西了