TelephonyManager.getLine1Number() failing?

We had the same problem in our project. The conclusion was that it depends on the SIM card.

What happened to us:

  • Galaxy S with AT&T SIM card: can read phone number, Settings shows number
  • Same Galaxy with an European SIM card: cannot read the number and “unknown” in Settings (cell phone was perfectly functional, just couldn’t read the number)

This has been reported in other forums as well.

In the end we decided to ask the user for the phone number. A bit more involved, actually: if( "SIM card present" && "cannot read the cell number") "ask user"; . Otherwise we will keep bugging the user that doesn’t a SIM card in the first place.

Leave a Comment