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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -