Muneerah Rashed
Muneerah Rashed

Reputation: 323

how i can access the internal android device information ?

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

Answers (2)

Gavin Harris
Gavin Harris

Reputation: 712

Have a look at the Build object.

https://developer.android.com/reference/android/os/Build.html

For instance,

Build.BOARD

Upvotes: 0

rahul
rahul

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

Related Questions