How to get Unique Device ID for Amazon Kindle Fire

Shane Oliver picture Shane Oliver · Nov 30, 2011 · Viewed 8.6k times · Source

To get the Unique Device ID on Android phones/tablets, we use the following:

((TelephonyManager) ctx.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId()

But for Kindle Fire, we can't get one.

Any ideas?

Answer

Lars picture Lars · Nov 30, 2011

You should try using the following line:

deviceId = Secure.getString(context.getContentResolver(), Secure.ANDROID_ID);

This will get the device ID from tablets, the code you're using only works on phones (it will return null on tablets)