itgoyo / AndroidSummary

12 stars 4 forks source link

Android获取手机唯一码 #126

Open itgoyo opened 3 years ago

itgoyo commented 3 years ago
 /**
     * 获取手机唯一码
     * @return
     */
    public static String getAndroidID() {
        String id = Settings.Secure.getString(
                Utils.getApp().getContentResolver(),
                Settings.Secure.ANDROID_ID
        );
        return id == null ? "" : id;
    }

大多数情况都是可以正常获取到