How to get the mobile number of current sim card in real device?

前端 未结 6 1580
春和景丽
春和景丽 2020-11-28 03:39

I have to make an application which shows the contact no of the SIM card that is being used in the cell. For that I need to use TelephonyManager class. Can I ge

6条回答
  •  情深已故
    2020-11-28 04:17

    Well, all could be temporary hacks, but there is no way to get mobile number of a user. It is against ethical policy.

    For eg, one of the answers above suggests getting all accounts and extracting from there. And it doesn't work anymore! All of these are hacks only.

    Only way to get user's mobile number is going through operator. If you have a tie-up with mobile operators like Aitel, Vodafone, etc, you can get user's mobile number in header of request from mobile handset when connected via mobile network internet.

    Not sure if any manufacturer tie ups to get specific permissions can help - not explored this area, but nothing documented atleast.

提交回复
热议问题