1

How is it possible to call a USSD with a text attached on android. For example: *455*1*Hello*0#. I have looked around the web and couldn't find any solution for it. The only question that seems to resemble what I want to achieve was asked 9 years ago here. Surely there is some API or a workaround available in Android after all these years?

  • I also tried to URI.encode all characters that aren't a number. No luck there as explained here.
  • I have thought of interacting with the dialog to insert the text but that will take a significant amount of time for the user which renders the app useless.
  • Neither ACTION_CALL intent nor placeCall API does anything to solve this.
  • Is it not in the protocol to send a text on the initial request?
  • TelephonyManager::sendUssdRequest(String, TelephonyManager.UssdResponseCallback, Handler) was introduced in API 26. I am targeting API 21 and above. I haven't checked if that solves it yet tho.
Brook MG
  • 601
  • 10
  • 20

1 Answers1

2

Take a look at this library seems to be what you are looking for.

Library is called VoIpUSSD by romellfudi incase link doesn't work.

Dr BigKitkat
  • 283
  • 1
  • 5
  • 13
  • I was looking for an API to do this correctly instead of a hacky method like this using accessibility but looks like I don't have any choice. Thanks – Brook MG Sep 07 '20 at 12:22