Get Mobile no from real device

前端 未结 3 1891
孤城傲影
孤城傲影 2021-01-05 06:50

I want to get the mobile number of a sim which is inserted into the device. I know as pr the android SDK TelephoneManger is the class by which we can get it by

3条回答
  •  离开以前
    2021-01-05 07:09

    You are using correct and the only approach available to the common user (AFAIK). It is mainly SIM dependent (it is not obligatory to have ), and in some cases may be device dependent (getLine1Number() not correctly implemented).

    To be more precise, IMSI uniquely identifies SIM. But MSISDN (the subscriber number) is not uniquely related to SIM, as it is possible to change MSISDN on the SIM. Network may use IMSI from SIM to find MSISDN in the HLR and establish the call.

    So, MSISDN is not mandatory to be on the SIM.

提交回复
热议问题