Example of sms app that register for this intent :
protected void onHandleIntent(Intent intent) {
if (intent != null) {
if (TelephonyManager.ACTION_RESPOND_VIA_MESSAGE.equals(intent.getAction())) {
String num = intent.getDataString();
num = num.replace("smsto:", "").replace("sms:", "");
String msg = intent.getStringExtra(Intent.EXTRA_TEXT);
// send the data to via intent
Intent intentService = new Intent(this, SomeClass.class);
startService(intentService);
}
}
}
sending msg via SmsManeger - smsManager.sendTextMessage(address, null, msg, piSent, piDelivered);