如果获取一个设备的唯一的一个标识不一定是手机,有可能是平板电脑

解决方案 »

  1.   


    Settings.Secure.getString(this.getContentResolver(), Settings.System.ANDROID_ID);
    试试这个
      

  2.   

    public String getId() {
            String id = android.provider.Settings.System.getString(super.getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
            return id;
        }
      

  3.   

    TelephonyManager tm = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
    String deviceId = tm.getDeviceId();
      

  4.   

    取wifi的mac地址,除了模拟器,其余设备应该都有
      

  5.   

    百度获取手机mac地址一些广告平台就是这样做的。