Tanuj Wadhwa
Tanuj Wadhwa

Reputation: 2045

How to find the device details for android

I want to find out about the name, android version, screen size, battery status, network status and other details of the device on which the app is running. Is there a specific inbuilt class for the device details or will I have to use some third party tool.

Upvotes: 3

Views: 3164

Answers (3)

Shalini
Shalini

Reputation: 1733

For getting Manufacturer,model and version use,

**

Build.MANUFACTURER
Build.MODEL;
Build.VERSION.RELEASE

**

For Screen Size use,

 Display display = getWindowManager().getDefaultDisplay(); 
        width = display.getWidth();  //deprecated
        height = display.getHeight();//deprecated

Upvotes: 5

josephus
josephus

Reputation: 8304

Unfortunately there's no single class or utility you can use to get all of that. You can however, visit these links for information on how to get each one of them:

Battery Level

Android Version

Screen Size

Network Status

I just googled each of them really. Good news is, you have google on your machine too!

Upvotes: 0

Kamal
Kamal

Reputation: 1415

    TelephonyManager tMgr =(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
     String mPhoneNumber = tMgr.getLine1Number();
     Log.i("model", android.os.Build.MODEL);
 WindowManager mWinMgr = (WindowManager)this.getSystemService(Context.WINDOW_SERVICE);
        _sWidth= mWinMgr.getDefaultDisplay().getWidth();
        _sHeight = mWinMgr.getDefaultDisplay().getHeight();

Upvotes: 0

Related Questions