简体   繁体   中英

error in detecting the device phone number in android application

I am developing an android application in which i have to get the device phone no in which my application is installed.I tried lot of ways.Searched google also.Bhe code that i am getting is for imei number,not the mobile no ??

But not got the result

I tried using

http://pastebin.com/15GMazLv

Can anyone guide me how to implement this ??

I will be really thankful to you

Regards Tushar Sahni

Is this what you are looking for?

TelephonyManager tmgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE) ; 
String phoneNum = tmgr.getLine1Number(); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM