0

> how to find get mobile no and imei no using android apps.


I am developing an app for a mobile carrier. First I wanted to find any of the things (IMSI, ICCID, IMEI, MSISDN) so that .

Now as a workaround I will ask the user to register his phone number with my app. But then again bad things will happen if user changes the SIM.

debid
  • 5
  • 5

2 Answers2

0

Use following for getting mobile number and IMEI number

TelephonyManager tm = (TelephonyManager)Your_Context getSystemService(Context.TELEPHONY_SERVICE);
// get IMEI
String imei = tm.getDeviceId();
String phone = tm.getLine1Number();

but its not always reliable on for example non phone device. You will also need to add permision "android.permission.READ_PHONE_STATE".

Sanket Shah
  • 4,352
  • 3
  • 21
  • 41
0

You can give this a try:

TelephonyManager telephonyManager = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE));

String imeiSIM1 = telephonyManager.getDeviceId();;

Refer this For More Clear Information

Hope this could Help

Community
  • 1
  • 1
Nitesh Tiwari
  • 4,742
  • 3
  • 28
  • 46