Blog Post

Android, JAVA, Mobile

Android: How to get cellphone number from SIM 

In some register forms you need to get the phone number in order to avoid that some users enters some invalid phones. So in order to achieve this you could detect the number from the SIM. The tricky point is that some Carriers does not have such info updated on the SIM, so in this scenarios this will not work.

Here there is a snapshot in which place you need to take a look to see if the phone is correct in the cellphone.

As you can see here the ‘My phone number’ is Unknown, so I do have a Carrier which does not update correctly the phone in the SIM ūüôā

In this scenario we do have register the phone.

The code in order to grab the information of the SIM in case the info is there is the following:

I hope this helps you!

(Visited 602 times, 1 visits today)

Related posts

Leave a Reply

Required fields are marked *

en_USEnglish
en_USEnglish