I want to programmatically display the mobile number of the device. My code: -
TelephonyManager telephonyManager = (TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE); String strMobileNumber = telephonyManager.getLine1Number();
and I set the READ_PHONE_STATE
permission in the AndroidManifest.xml file. This works on the emulator, but on the device with the eclair version itself, it returns an empty string. Is there any other way to get mobile connection?
gauri source share