我必须发送这个 jasonObject 才能得到响应
[“设备编号”:“****”, “device_locale”:“ar”, “操作系统”:“安卓”]
我如何访问此信息:设备 ID 和本地语言?
最佳答案
您可以使用以下实用程序类来获取设备 ID 和区域设置。
public class DeviceInfoUtil {
public static String getDeviceId(Context context){
return Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
}
public static String getDeviceLocale(){
return Locale.getDefault().getLanguage();
}
}
关于android - 我如何访问内部 Android 设备信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42378572/