Hardware ID

323 views
Skip to first unread message

Olivier Guilyardi

unread,
Mar 23, 2011, 1:31:32 PM3/23/11
to andro...@googlegroups.com
Hi,

I need a reliable and unique device ID, in order to generate license keys.

So far I've used TelefonyManager.getDeviceId(). But this isn't reliable, it may
not work on certain non-phone devices.

I read about WifiInfo.getMacAddress(), but on certain devices this seems no to
work if wifi is deactivated. This is a problem in my case.

I don't want Settings.Secure.ANDROID_ID, because first it can be null sometimes
(this has be reported on certain devices) and it can change on factory reset, if
the user installs an alternative ROM, etc..

But, is there a CPU ID? Something like an ARM serial number? I looked into
/proc/cpuinfo but all I get is:
Serial: 0000000000000000

On the Droid, there is a /proc/phoneid which contains an apparently useful
value, but it's not present on some other device.

Anything else?

Thanks

--
Olivier

mic _

unread,
Mar 23, 2011, 2:20:11 PM3/23/11
to andro...@googlegroups.com
I'm not aware of any hardware serial numbers for ARM cpus. Maybe you
could use a combination of getDeviceId and getMacAddress? I mean, if
the device has neither a SIM card nor WiFi then how did the user
download your app? (sure, ethernet is a possibility, though I've
never seen an Android device with an ethernet connector).

/Michael

> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
>
>

Olivier Guilyardi

unread,
Mar 23, 2011, 2:44:10 PM3/23/11
to andro...@googlegroups.com
The issue is that I use the device ID to validate the stored license key
whenever the app is launched. And this can happen a long time after download.
Plus, I don't want to require the user to activate Wifi whenever using my app,
because he may have turned it off to preserve battery, and my app doesn't need
to connect to the internet anyway.

And I can't store the MAC address in the user preferences and rely on that,
because one could simply copy the preferences file to another device.

Olivier

Reply all
Reply to author
Forward
0 new messages