3

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.

Tanuj Wadhwa
  • 2,025
  • 9
  • 35
  • 57
  • http://developer.android.com/reference/android/telephony/TelephonyManager.html and http://developer.android.com/training/monitoring-device-state/battery-monitoring.html – Mohsin Naeem Jul 18 '12 at 10:05

3 Answers3

5

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
Shalini
  • 1,733
  • 4
  • 17
  • 31
  • Just want to point out that the way you're getting the Screen Size is now deprecated =/. – Carnal Jul 18 '12 at 10:31
  • DisplayMetrics metrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metrics); int height = metrics.heightPixels; int width = metrics.widthPixels; – Carnal Jul 18 '12 at 10:32
0
    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();
Kamal
  • 1,415
  • 13
  • 24
0

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!

Community
  • 1
  • 1
josephus
  • 8,284
  • 1
  • 37
  • 57