Get mobile Number on GSM Mobile using android code
问题 I am using following android code to get mobile number and it's working on android emulators only: TelephonyManager tm =(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String number = tm.getLine1Number(); But when I tested it in real device ( Samsung Galaxy Chat B5330 ) it gives nothing (Empty String) Please help with some code snippet. 回答1: For GSM, the phone number is on the SIM card, and some carriers just don't put it on the card, and then the phone does not know what it is