I tried googling in google but unable to find the answer
Will anyone please let me know, how can i retrieve the current phone number from the android code. I think p
TelephonyManager tm = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
String phonenumber = tm.getLine1Number();
This link may be the best collection of TelephonyManager related answers. But still it is not guaranteed that you will be returned a telephone number.
Check this out!
You can try:
TelephonyManager phoneManager = (TelephonyManager)
getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
String phoneNumber = phoneManager.getLine1Number();
Needs READ_PHONE_STATE
permission.