5

Its very much frustrating situation now in project. I am stuck up at one point. I want do a simple task as follows

  1. When someone change the SIM, detect this event and check if this new SIM is different from previous SIM and take action accordingly.
  2. I don't want to check the SIM_STATE periodically by timer or anything..
  3. Do android notify the state change of SIM? If yes please let me know I can detect the SIM change?

I have asked this question before also but no solid answer I got. It seems a very important API and no one care about it. Please provide me some code snippet if you have please...

I am stuck up here and in the android telephony service documentation I don't able to understand anything... It will very helpful if anyone can provide some code for the above.

Surjya Narayana Padhi
  • 7,741
  • 25
  • 81
  • 130
  • 2
    SIM can't be changed without a power down can they? You probably only need to check on app start. See this question for how determine SIM ID – Preet Sangha Jun 13 '12 at 06:27
  • 6
    There are MANY dupes to this quesiton. This one has an answer : http://stackoverflow.com/questions/8629766/android-sim-change There is also this http://stackoverflow.com/questions/5389512/event-when-sim-is-changed and this http://stackoverflow.com/questions/5548751/phone-sim-change-notification Check these posts and if they don't work, come back with the results. – gideon Jun 13 '12 at 06:28
  • 1
    if you are not getting phone number using getLine1Number, then used sim serial number to compare previous one on boot complete. – Hiren Dabhi Jun 13 '12 at 07:49

1 Answers1

1

Yes, You can do only when application restart, at boot time receiver, so we have to register boot time receiver in our application. and when user change it we can analyse it .

abhi
  • 759
  • 6
  • 15