Hi,
How do we fetch phone number to use inside our application?
By using below code we can retrieve the phone number:
TelephonyManager mTelephonyMgr; mTelephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE); String mblNumber = mTelephonyMgr.getLine1Number();
Note: Dont forget to add READ_PHONE_STATE permission to be added inside the AndroidManifest.xml file:
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
FYI, i have tested this in my Samsung Galaxy 3(Version 2.2 and Vodafone is the Carrier) and Its working fine for me.