1
我要送這jasonObject獲得響應我如何訪問內部的Android設備信息?
[ 「DEVICE_ID」: 「****」, 「device_locale」: 「AR」, 「OS」: 「機器人」]
我如何訪問這些信息:設備ID和本地語言?
我要送這jasonObject獲得響應我如何訪問內部的Android設備信息?
[ 「DEVICE_ID」: 「****」, 「device_locale」: 「AR」, 「OS」: 「機器人」]
我如何訪問這些信息:設備ID和本地語言?
您可以使用下面的util類來獲取設備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();
}
}