Get Mobile no from real device

前端 未结 3 1920
孤城傲影
孤城傲影 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

    In that case you always save your phone no using SharedPreference by using the method getLine1Number() method. when you install your application then your phone number is saven and when when new sim card is used then send SMS to ur registered number. you have to always check after starting the application that your stored number is same with your new number.if same nothing will be happned ,if not same then ur app will send SMS.

提交回复
热议问题