您的位置:首页 > 移动开发 > Android开发

获取Android 唯一标识

2011-06-01 18:05 330 查看
1.使用ANDROID_ID
import
android
.
provider
.
Settings
.
Secure
;

private

String
android_id
=

Secure
.
getString
(
getContext
().
getContentResolver
(),

                                                       
Secure
.
ANDROID_ID
);

这个值应该是在系统第一次启动后计算出来的,设备恢复出厂设置之后,再次启动这个值可能会改变。

2.2版本的会有问题。

2.使用wifi网卡mac地址

WifiManager
wm
=

(
WifiManager
)
Ctxt
.
getSystemService
(
Context
.
WIFI_SERVICE
);

wm
.
getConnectionInfo
().
getMacAddress
();

3.Device ID

String
deviceId
=

((
TelephonyManager
)
context
.
getSystemService
(

Context
.
TELEPHONY_SERVICE
)).
getDeviceId
();

[/code]

[/code]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android service string