Zoraf
Zoraf

Reputation: 191

AT Command: USSD

I am trying to make USSD call to send AT command. When I execute code, I get following error:

"Error running exec(). Command: [AT+CUSD=1,"*222#",15] Working Directory: null Environment: null"

My code is:

String args="AT+CUSD=1,\"*222#\",15";
try {
     java.lang.Process process=Runtime.getRuntime().exec(args);
     BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
     Log.e("zoraf",bufferedReader.toString());

} catch (IOException e) {
     e.printStackTrace();
}

What can be done to solve this issue ?

Upvotes: 0

Views: 883

Answers (1)

hlovdal
hlovdal

Reputation: 28258

It seams that you lack some basic understanding of what AT commands are and how they operate. AT commands are not something that you pass to a shell or the operating system like Runtime.getRuntime().exec(args) implies. AT commands are text command that you send to a modem over a serial interface (e.g. USB, Bluetooth, RS-232 or a virtual one).

The absolutely best place for you to start is to read all of chapter 5 of the V.250 specification. It is an extremely important document that will guaranteed teach you much more about AT commands than you currently know.

Upvotes: 1

Related Questions