唯一标识一个Android手机 [英] Uniquely Identify an Android Handset

查看:319
本文介绍了唯一标识一个Android手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个唯一的ID给到Android handests是可以通过SDK?

Is there a unique ID that is given to Android handests that is available through the SDK?

我想提供一个Web服务与只能使用一次每个资源每个用户进行的操作。也许有一种不同的方式来进行此事。任何想法?

I want to provide a web-service with actions that can only be performed once per resource per user. Maybe there is a different way to go about this. Any ideas?

推荐答案

使用的手机IMEI如下所述:的 http://www.androidsoftwaredeveloper.com/2009/04/02/how-to-get-the-phone-imei/

Use the phone Imei as described here: http://www.androidsoftwaredeveloper.com/2009/04/02/how-to-get-the-phone-imei/

String imei = TelephonyManager.getDefault().getDeviceId();
if (TextUtils.isEmpty(imei)) {
   return "";
}

您需要读取手机状态的权限来访问这些数据。所以,你必须添加

You need the read phone state permission to access this data. So you have to add

<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

你的清单文件。

to your manifest file.

这篇关于唯一标识一个Android手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆