如何检测另一台Android设备? [英] How to detect another Android device?

查看:59
本文介绍了如何检测另一台Android设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,如果我在一台Android设备上运行我的应用程序,然后尝试在另一台Android设备上运行同一应用程序,则需要首先检查它是否是另一台设备,如果是,那么我应该继续.您能否告诉我是否有什么方法可以实现这一目标?

I have a requirement that if I run my app in one Android device and then try to run the same app in another Android device I need to check first if its another device or not and if it is then I should continue. Could you please tell me if there is any way in which I can achieve this?

谢谢.

推荐答案

您可以使用:

telephonyManager = (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE);
telephonyManager.getDeviceId();
telephonyManager.getSimSerialNumber();

getDeviceId getSimSerialNumber 在每个设备上都是唯一的,因此您可以检查此值

getDeviceId and getSimSerialNumber are unique per device, so you can check this values

这篇关于如何检测另一台Android设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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