Reputation: 323
I have to send this jasonObject to get the response
["device_id" : "****", "device_locale" : "ar", "os" : "android" ]
how i can access this information : device id and the local language ?
Upvotes: 1
Views: 64
Reputation: 712
Have a look at the Build object.
https://developer.android.com/reference/android/os/Build.html
For instance,
Build.BOARD
Upvotes: 0
Reputation: 208
You can use the below util class to get the device ID and the Locale.
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();
}
}
Upvotes: 1