I am trying to read the phone number of the device using the following code. When phone number is not available I read the subcriber id. It works in some phones and throws N
Sometimes the phone number is not set in the phone's settings. In these cases, getLine1Number() will return null. You will need to figure out an alternate way of tracking whatever you're tracking.
This is an issue that people run into a lot. I don't program on android much, but ive seen this get asked a lot. Make sure you use the search to check if the question you're asking has been asked before.