How to get Owner/sim number and Network Mode

后端 未结 4 1721
野的像风
野的像风 2021-01-15 17:01

I want to get the SIM number which currently in the phone i.e. owner number. and network mode whether it is GSM or CDMA.

I search on net and try to do this by getLin

4条回答
  •  耶瑟儿~
    2021-01-15 17:53

    For the phone number you can do,

    // Get the phone number from the telephony manager, and display it
    TelephonyManager info = (TelephonyManager)getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE);
    String phoneNumber = info.getLine1Number();
    

    For the network mode, see TelephonyManager

提交回复
热议问题