Runtime Error
The command to send SMS text messages from GAMMU is
gammu --sendsms ems 144 -text Hello
wiith 144 a sample number.
I, therefore, use the code
Runtime.getRuntime().exec("gammu --sendsms ems 144 -text Hello");
to send an sms text message from Java.
Now, supposing the text contains more than one word. In GAMMU i can do
gammu --sendsms ems 144 -text"Hello World"
or
gammu --sendsms ems 144 -text Hello\ World
which in Java code I may do
Runtime.getRuntime().exec("gammu --sendsms ems 144 -text \"Hello World\"");
or
Runtime.getRuntime().exec("gammu --sendsms ems 144 -text Hello\ World");
to perform the operation. I have the number read from a database and the message too. Here is a sample code
String number = resultSet.getString("number");
String message = resultSet.getString("messageToSend");
String command ="gammu --sendsms ems " + number +" -text \"" + message +"\"";
Runtime.getRuntime().exec(command);
This code is not working because the sample command below
gammu --sendsms ems 144 -text Hello World
returns an error message
Unknown parameter"World"
because of the space between hello and world. This error is also present in Runtime despite my specifying the message in double quotes. Could anyone help me out here?
Thanks.

