使用android MAC地址作为唯一标识符
作者:互联网
我一直在阅读有关android没有唯一标识符的stackoverflow上的一些帖子.但我不能将设备的MAC地址用作唯一ID吗?如果没有,为什么不呢?如果是的话,是否有人知道如何以编程方式获取它(即一段代码[请])?
供参考:
我的应用程序需要网络,因此没有网络的设备将无法安装它.
解决方法:
But could I not use the MAC address of the device as a unique id?
不是100%可靠.
If not, why not?
Here is what Google has to say on the subject:
It may be possible to retrieve a Mac address from a device’s WiFi or Bluetooth hardware. We do not recommend using this as a unique identifier. To start with, not all devices have WiFi. Also, if the WiFi is not turned on, the hardware may not report the Mac address.
此外,您假设所有设备都将通过某种方式准确地报告MAC地址.我认为自定义ROM,也许是有根设备,可能会欺骗MAC地址.这可能是也可能不是你的担忧 – 我只是指出来.
My app requires network
充其量,它可能需要WiFi.它不能要求打开WiFi.
does anyone know how to get it programmatically (i.e. a piece of code [please])?
标签:android,mac-address 来源: https://codeday.me/bug/20190712/1443965.html