telephonymanager - How to find the mobile phone number in android? -


i developing small android application in want find mobile phone number used in particular phone

i tried following

telephonymanager tmgr =(telephonymanager)this.getsystemservice(context.telephony_service); string mphonenumber = tmgr.getline1number(); 

it working fine in emulator not working in phone

please me how that

you may want @ question, there no better way, , may need ensure app has read_phone_state permission, but, sim may not returning it.

i nervous phone trying value. why need it, there may better way want.

programmatically obtain phone number of android phone


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -