2

How to get Device Serial Number? I don't want Device ID. I want Serial number (the one which we see in Devices view in Eclipse). If there is no way to get it, can I at least know where is it stored?

2 Answers 2

1

As long as you are using API 9

Build.SERIAL 

Should return the same value as Eclipse shows.

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

1 Comment

Is this the same serial number as the one usually printed on the device?
0
You can use the getprop command on the adb shell and check yourself that which of the files contains the correct Serial number.Many times the serial number is located on different files and code has to be device specific. Foe samung Tab 3 you can use the following code: filename=sys.serial//for samsung tab 3 filename=ro.serial//for samsung t211 tab filename=ril.serial//for samsung 10inch note try { Class<?> c = Class.forName("android.os.SystemProperties"); Method get = c.getMethod("get", String.class, String.class); serialnum = (String) (get.invoke(c, filename, "unknown")); } catch (Exception ignored) { serialnum = "unknown"; } 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.