</string>
<string name="sms_help">
Usage: sms phone_number message\n
- Sends an sms with text <message> to <phone_number>.\n
+ Sends an sms with text <message> to <phone_number>. This command requests a delivery report. If you do not want one, use the SMSQ command.\n
Example: sms 0755555555 \"Test message\"
</string>
+ <string name="smsq_help">
+ Usage: smsq phone_number message\n
+ Sends an sms with text <message> to <phone_number>. This command does not request a delivery report. If you want one, use the SMS command.\n
+ Example: smsq 0755555555 \"Test message\"
+ </string>
<string name="setpassword_help">
Usage: setpassword [password]\n
With no argument, clears the device password.\n
case SMS:
Utils.sendMessage(context, replyTo, sms_help);
break;
+ case SMSQ:
+ Utils.sendMessage(context, replyTo, smsq_help);
+ break;
case SMSLOG:
Utils.sendMessage(context, replyTo, smslog_help);
break;
* @param destination destination phone number
* @param text text message contents
*/
- public static void sms(final Context context, final Address replyTo, final String destination, final String text){
+ public static void sms(final Context context, final Address replyTo, final String destination, final String text, final boolean quiet){
final SmsManager manager=SmsManager.getDefault();
final ArrayList<String> messages=manager.divideMessage(text);
if(messages.size() > 1)
}
Log.d(Heavy.class.getName(), "Sending sms to "+destination);
- manager.sendMultipartTextMessage(destination, null, messages, sents, delivereds);
+ manager.sendMultipartTextMessage(destination, null, messages, sents, quiet ? null : delivereds);
}
/**
*/
@SuppressWarnings("javadoc")
public static enum Command{
- TOAST, ECHO, SMS, FLASH, WIFI,
+ TOAST, ECHO, SMS, SMSQ, FLASH, WIFI,
BLUETOOTH, DIAL, RING, SPEAK, VIBRATE,
DIALOG, LOCATION, NOLOCATION, RINGER, NCFILE,
PHOTO, SETNOTIFICATION, DELNOTIFICATION, SETPASSWORD, HELP,
Heavy.help(context, replyTo, toNonNull(Command.SMS));
break;
}
- Heavy.sms(context, replyTo, toNonNull(args[0]), join(" ", 1, args));
+ Heavy.sms(context, replyTo, toNonNull(args[0]), join(" ", 1, args), false);
+ break;
+
+ case SMSQ:
+ if(args.length < 2){
+ Heavy.help(context, replyTo, toNonNull(Command.SMSQ));
+ break;
+ }
+ Heavy.sms(context, replyTo, toNonNull(args[0]), join(" ", 1, args), true);
break;
case FLASH: