How to find serial number of Android device?

后端 未结 17 2174
借酒劲吻你
借酒劲吻你 2020-11-22 14:07

I need to use a unique ID for an Android app and I thought the serial number for the device would be a good candidate. How do I retrieve the serial number of an Android devi

17条回答
  •  忘掉有多难
    2020-11-22 14:41

    As @haserman says:

    TelephonyManager tManager = (TelephonyManager)myActivity.getSystemService(Context.TELEPHONY_SERVICE);
    String uid = tManager.getDeviceId();
    

    But it's necessary including the permission in the manifest file:

    
    

提交回复
热议问题