telephonymanager.getLine1Number()
does not guarantee to return the Sim number, as the phone number is not physically stored on all Sim cards.
A better alternative is to ask the user for the phone number once, and confirm the same by sending a message to that number.
Here is a better explanation for the same.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…