Update DeviceInfoUtils.java

dev
wangsiyuan 2024-05-16 00:55:14 +08:00
parent b3752e4716
commit 620235c089
1 changed files with 14 additions and 8 deletions

View File

@ -1,15 +1,16 @@
package com.nbee.echolink.utils;
import java.util.Locale;
import android.content.Context;
import android.os.Build;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.Log;
public class DeviceInfoUtils {
/**
* px
*
*/
public static int getDeviceWidth(Context context) {
return context.getResources().getDisplayMetrics().widthPixels;
@ -21,6 +22,7 @@ public class DeviceInfoUtils {
public static int getDeviceHeight(Context context) {
return context.getResources().getDisplayMetrics().heightPixels;
}
/**
*
**/
@ -64,8 +66,6 @@ public class DeviceInfoUtils {
}
/**
*
*
* fingerprit
**/
public static String getDeviceFubgerprint() {
@ -74,7 +74,6 @@ public class DeviceInfoUtils {
/**
*
*
**/
public static String getDeviceHardware() {
return android.os.Build.HARDWARE;
@ -82,14 +81,12 @@ public class DeviceInfoUtils {
/**
*
*
**/
public static String getDeviceHost() {
return android.os.Build.HOST;
}
/**
*
* ID
**/
public static String getDeviceDisplay() {
@ -98,15 +95,24 @@ public class DeviceInfoUtils {
/**
* ID
*
**/
public static String getDeviceId() {
return android.os.Build.ID;
}
/**
*
* Android ID
*
* @param context 访
* @return Android ID64
*/
public static String getAndroidID(Context context) {
// 通过Settings.Secure.getString获取设备的Android ID
return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
}
/**
*
**/
public static String getDeviceUser() {
return android.os.Build.USER;