How is it possible to do USSD requests on Android?

前端 未结 5 589
别跟我提以往
别跟我提以往 2020-11-27 17:31

Some custom dialer apps (for example, Dialer from MotoBlur) are able to do USSD requests. Is it realy impossible to do this via SDK?

5条回答
  •  忘掉有多难
    2020-11-27 17:47

    You can dial ussd requests like any other number with an call-intent like this one:

    String encodedHash = Uri.encode("#");
    String ussd = "*" + encodedHash + "12345" + encodedHash;
    startActivityForResult(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussd)), 1);
    

    However, afaik, it's currently not possible to parse the result string in your app.

提交回复
热议问题