1 android 获取 imei号码2
3 核心代码:4
5 Imei =((TelephonyManager) getSystemService(TELEPHONY_SERVICE))6 .getDeviceId();7
8 1.加入权限9
10 在manifest.xml文件中要添加
11
12 2.代码13
14 /**
15 *16 *17 *创建日期 2010-4-29 下午05:02:4718 *19 */
20 packagenet.sunniwell.app;21 importandroid.app.Activity;22 importandroid.os.Bundle;23 importandroid.telephony.CellLocation;24 importandroid.telephony.PhoneStateListener;25 importandroid.telephony.TelephonyManager;26 public class TelManager extendsActivity {27
28 @Override29 protected voidonCreate(Bundle savedInstanceState) {30 super.onCreate(savedInstanceState);31 TelephonyManager tm = (TelephonyManager) this.getSystemService(TELEPHONY_SERVICE);32
33 /*
34 * 电话状态:35 * 1.tm.CALL_STATE_IDLE=0 无活动36 * 2.tm.CALL_STATE_RINGING=1 响铃37 * 3.tm.CALL_STATE_OFFHOOK=2 摘机38 */
39 tm.getCallState();//int