【发布时间】:2013-11-05 08:40:35
【问题描述】:
我正在开发一个允许用户从多个 android 设备登录的应用程序(服务器-android 客户端)。当用户登录设备时,该设备将在服务器端注册,但我不知道如何避免重复,所以我想知道有没有机会唯一识别一个 android 设备?我认为 Google Play 和 Facebook 可以做到这一点。
【问题讨论】:
标签: android
我正在开发一个允许用户从多个 android 设备登录的应用程序(服务器-android 客户端)。当用户登录设备时,该设备将在服务器端注册,但我不知道如何避免重复,所以我想知道有没有机会唯一识别一个 android 设备?我认为 Google Play 和 Facebook 可以做到这一点。
【问题讨论】:
标签: android
【讨论】:
It is generally not recommended to use MAC address for any form of user identification. As a result, as of Android M, local device MAC addresses (for example, Wifi and Bluetooth) are not available via third party APIs. The WifiInfo.getMacAddress() method and the BluetoothAdapter.getDefaultAdapter().getAddress() method will both return 02:00:00:00:00:00.
有多种可用选项,但不能 100% 保证它们始终有效。见安卓开发者博文:http://android-developers.blogspot.in/2011/03/identifying-app-installations.html
提到的最佳方法是Settings.Secure.ANDROID_ID