Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect another Android device?

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?

Thank you.

like image 552
Ingrid Cooper Avatar asked Apr 17 '26 21:04

Ingrid Cooper


1 Answers

you can use this:

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

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

like image 134
Tomer Mor Avatar answered Apr 25 '26 01:04

Tomer Mor