0

Are there known bugs or issues with getConnectionInfo().getMacAddress() when it's used as a unique device identifier?

One of the alternatives, the Android ID, seems to be not available (or not really unique) on some tablets. FAIL...

ledy
  • 1,527
  • 6
  • 22
  • 33

2 Answers2

1

The only problem that I know of is that it is only available if Wi-Fi is enabled.

I think this is a big problem because some smartphone users probably never turn Wi-Fi on. Your app can turn Wi-Fi on itself, but this means your app needs an additional permission "android.permission.CHANGE_WIFI_STATE".

Your general issue - how to uniquely identify the device - is widely discussed, e.g.

Is there a unique Android device ID?

http://android-developers.blogspot.ca/2011/03/identifying-app-installations.html

Community
  • 1
  • 1
Tom
  • 17,103
  • 8
  • 67
  • 75
0

In this video from last year Google I/O, Reto Meier talked about exactly that problem off identifieng a device correctly.

For the solution you will have to watch the video, because I don't remember it anymore. But I do remember his concerns about the "MacAddress"-Solution. The problem about this solution his that it addresses a particular device and not a particular "installation", think of the problem when a user, who installed your app, sells his phone to another person which will also install your app. With the MacAddress you have no chance to distinct between those two ...

Christoph Haefner
  • 1,093
  • 1
  • 9
  • 25
  • If the re-sold devices are the only problem, then i'd be happy. However, I fear a bit more, that any manufacturer or buggy modified android version is sending a zero address instead of unique IDs. or one does not provide this ID properly when there wifi turned off. All emulators that I have, return the ID properly, but i can never be sure... – ledy Aug 09 '12 at 11:17
  • Yeah, I think this zero-if-wifi-turned-off-thing is also what he mentioned in his talk. I highly encourage you to watch the video, because I'm pretty sure he gives a solution to this problem. – Christoph Haefner Aug 09 '12 at 11:27