android - Device Phone Number -


i need way capture android device's phone number in order send web api processing.

i've read issues , inconsistencies getline1number function question this, there programmatic alternatives getline1number or available method retrieve device phone number?

to clear, not looking uuid, mobile phone application , require users phone number data association.

you can use getline1number () this. returns phone number string line 1, example, msisdn gsm phone. return null if unavailable.

here example:

telephonymanager tm = (telephonymanager)getsystemservice(telephony_service);  string number = tm.getline1number(); 

it requires read_phone_state permission added on androidmanifest.xml file.


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -