Example code for Android to obtain SIM card information of dual card dual standby mobile phone

preface

The function of mobile phone number needs to be verified, but most domestic mobile phones are dual card and dual standby, so they can't get two numbers. The official document of Android does not provide the corresponding API, because the standard Andoird does not have dual cards. It seems that only China will engage in dual cards and dual standby artifact.

The following is a record of what you have learned to do this function.

Android obtains the local phone number (applicable to dual card and dual standby phones)

Direct code:

Of course, don't forget to add permissions:

Get SIM card information of dual card dual standby mobile phone

Using reflection to traverse the method in the telephonymanager, you can basically find the method to obtain the dual card and dual standby number through the naked eye, and finally get the SIM card information through reflection.

Whether you can get the mobile phone number depends on the mobile phone card. Most mobile phone cards can't get the mobile phone number, but can only get the SIM card serial number.

summary

The above is the whole content of this article. I hope the content of this article has a certain reference value for your study or work. If you have any questions, you can leave a message. Thank you for your support for programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>