8

how can i get android device's platformId,deviceUser,deviceName,deviceModel, deviceOperatingSystem,deviceOSVersion from my program.

Edit: i have already used that Build class and got device id, model and user but for my requirement i need device OS, OS version and platform id.so how can i get them??

thanks
venu

3 Answers 3

6

Use android.os.Build.

Sign up to request clarification or add additional context in comments.

1 Comment

thank u @CommonsWare, can u please have a look at my edit section??
5

Here's an example:

StringBuffer buf = new StringBuffer(); buf.append("VERSION.RELEASE {"+Build.VERSION.RELEASE+"}"); buf.append("\nVERSION.INCREMENTAL {"+Build.VERSION.INCREMENTAL+"}"); buf.append("\nVERSION.SDK_INT {"+Build.VERSION.SDK_INT+"}"); buf.append("\nFINGERPRINT {"+Build.FINGERPRINT+"}"); buf.append("\nBOARD {"+Build.BOARD+"}"); buf.append("\nBRAND {"+Build.BRAND+"}"); buf.append("\nDEVICE {"+Build.DEVICE+"}"); buf.append("\nMANUFACTURER {"+Build.MANUFACTURER+"}"); buf.append("\nMODEL {"+Build.MODEL+"}"); 

Complete android.os.Build documentation is at http://developer.android.com/reference/android/os/Build.html

Note that VERSION.SDK is marked as deprecated, so VERSION.SDK_INT was used instead.

Comments

4

Extending to what CommonsWare suggested, I think here's what you need:

Build.VERSION_CODES: Enumeration of the currently known SDK version codes. These are the values that can be found in SDK. Version numbers increment monotonically with each official platform release.

  1. DONUT : Constant Value: 4 (0x00000004)
  2. ECLAIR : Constant Value: 5 (0x00000005)
  3. ECLAIR_0_1 : Constant Value: 6 (0x00000006)
  4. ECLAIR_MR1 : Constant Value: 7 (0x00000007)
  5. FROYO : Constant Value: 8 (0x00000008)
  6. GINGERBREAD : Constant Value: 9 (0x00000009)

Build class: Information about the current build, extracted from system properties.
Build.MODEL
Build.PRODUCT

Build.VERSION: Various version strings.
Build.VERSION.RELEASE
Build.VERSION.SDK_INT

1 Comment

thanks to both @CommonsWare and @TheCottonSilk, i got the solution from Build class.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.