Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Android USSD code example

private Uri ussdToCallableUri(String ussd) {

    String uriString = "";

    if(!ussd.startsWith("tel:"))
        uriString += "tel:";

    for(char c : ussd.toCharArray()) {

        if(c == '#')
            uriString += Uri.encode("#");
        else
            uriString += c;
    }

    return Uri.parse(uriString);
}
Comment

Android USSD code example

String ussdCode = "*123#";
Intent intent = new Intent(Intent.ACTION_CALL);
intent.setData(ussdToCallableUri(ussdCode));
try{
    startActivity(intent);
} catch (SecurityException e){
    e.printStackTrace();
}
Comment

Android USSD code example

String ussdCode = "*" + "123" + Uri.encode("#");
startActivity(new Intent("android.intent.action.CALL", Uri.parse("tel:" + ussdCode)));
Comment

PREVIOUS NEXT
Code Example
Java :: java.lang.ArrayIndexOutOfBoundsException: 4 
Java :: Uri/beecrowd problem no 1118 solution in Java 
Java :: convert kotlin to java online editor 
Java :: spring converter in initbinder 
Java :: concludes() Method 
Java :: how to validate information against the database in java 
Java :: data.sql not loading in springboot 
Java :: spring component 
Java :: object class java 
Java :: what is method overriding in java 
Java :: java recursion 
Java :: split each character in a string (java) 
Java :: how to set current item for spinner android 
Java :: how to access methods from another class in java 
Java :: how to get stack trace of a function in java 
Java :: java stream group by multiple fields 
Java :: how to call child class method from parent class in java 
Java :: convert array to arraylist 
Java :: java 8 function supplier consumer 
Java :: my animal list 
Java :: matlab leslie eigenvalue java 
Sql :: codeigniter print last sql query 
Sql :: sql server 2016 reseed identity 
Sql :: how to get yesterday date in sql 
Sql :: mysql how to reset primary key 
Sql :: postgresql generate uuid 
Sql :: show databases in sql server 
Sql :: query to find table size in oracle 12c 
Sql :: sqlite rename column 
Sql :: oracle search text in all packages 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =