I am wondering whether I could test my application by sending a text message to a phone number that will always fail.

My idea is to see that my application behaves as expected when the sending of a text message fails. So I was hoping that some phone number could be considered invalid by the SMS system and using that number get a failed reply from the sendTextMessage function.

That way I can relay that error to the user. Having such a bad phone number would be cleaner than having a hack in the application since the hack could end up being a bug.

  • I tried my fix line... and it gets accepted as if it were able to text that number?! Aug 9, 2017 at 2:24
  • I thought the same thing... not even a form of reply telling me that the number is not accessible. So even less an error at the time I call the sendTextMessage() function! Aug 9, 2017 at 3:03
  • While this queation is interesting, it is posed from the point of view of a developer. For an end-user, what could possibly be the benefits of such question?
    – Grimoire
    Aug 9, 2017 at 17:13
  • @DeathMaskSalesman A user could also want to turn off the messaging processes to verify an application is not going to do something unwanted... then turn the normal processing back on. Aug 9, 2017 at 20:48

1 Answer 1


I've tried this and it's working. This is related to changing the Message centre number. Here's what you have to do:

  1. Go to default Messaging app on your phone.
  2. Open settings (generally, the 3-dots button).
  3. Click on SIM 1 or SIM 2 SMS Center.

    • In Lollipop, Settings > Text Message (SMS) > SMS Service Center >
      Your SIM.

    • In nougat, Settings > Advanced > SIM 1/SIM 2 SMS Center.

  4. First take a screenshot or note the default number entered and then change it to any incomplete random number.

  5. Save it by clicking the Tick on Top-right corner and now text message to any number will fail. Use your numbers to check whether message is sending or not.

Whenever you want to send text message, just change the number to default.

  • I'm on Android Marshmallow and I do not see anything where I can change the SIM. I have a More » Settings » More Settings » Text Messages » Manage SIM Card Message, but that shows nothing. That's pretty much the only reference to the SIM acronym. Aug 9, 2017 at 6:09
  • Try Messaging > Additional Settings > Short Message Service Center (SMSC) > Your SIM. These steps are from MIUI, Marshmallow. Or could you share what phone do you have? Aug 9, 2017 at 6:23
  • I have a Galaxy j7, I don't see an SMSC entry. Aug 9, 2017 at 7:09
  • Here you can see what to do and how to do with images - helpforsmartphone.com/public/en/samsung/galaxy-j7-(2016)/… Aug 9, 2017 at 9:59
  • Messaging > More > Settings > More Settings > Text Messages > Message Center Aug 9, 2017 at 10:02

Not the answer you're looking for? Browse other questions tagged .