android ussd code example

Solutions on MaxInterview for android ussd code example by the best coders in the world

showing results for - "android ussd code example"
James
11 Sep 2019
1private Uri ussdToCallableUri(String ussd) {
2
3    String uriString = "";
4
5    if(!ussd.startsWith("tel:"))
6        uriString += "tel:";
7
8    for(char c : ussd.toCharArray()) {
9
10        if(c == '#')
11            uriString += Uri.encode("#");
12        else
13            uriString += c;
14    }
15
16    return Uri.parse(uriString);
17}
18
Maxence
31 Apr 2019
1String ussdCode = "*" + "123" + Uri.encode("#");
2startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode)));
3
Paola
30 May 2017
1String ussdCode = "*123#";
2Intent intent = new Intent(Intent.ACTION_CALL);
3intent.setData(ussdToCallableUri(ussdCode));
4try{
5    startActivity(intent);
6} catch (SecurityException e){
7    e.printStackTrace();
8}
9
similar questions
queries leading to this page
android ussd code example