I know how to send sms from Android. It's very simple:
smsManager := TJSmsManager.JavaClass.getDefault;
smsTo := StringToJString('number_xxx');
smsManager.sendTextMessage(smsTo, nil, StringToJString('Test SMS'), nil, nil);
But the question is: How to send sms with delivery recipient? Is it possible in Delphi XE5?
Thanks for your answers.
From the Android's documentation:
destinationAddressthe address to send the message to
scAddressis the service center address or null to use the current default SMSC
textthe body of the message to send
sentIntentif not NULL this PendingIntent is broadcast when the message is successfully sent, or failed. The result code will be Activity.RESULT_OK for success, or one of these errors: RESULT_ERROR_GENERIC_FAILURE RESULT_ERROR_RADIO_OFF RESULT_ERROR_NULL_PDU. The per-application based SMS control checks sentIntent. If sentIntent is NULL the caller will be checked against all unknown applications, which cause smaller number of SMS to be sent in checking period.
deliveryIntentif not NULL this PendingIntent is broadcast when the message is delivered to the recipient. The raw pdu of the status report is in the extended data ("pdu").
You're clearly missing the last two parameters in your code.
Here's how to do that in Java - it's pretty straightforward, but Delphi makes in a bit harder for us. Have a look at the answer here. The most interesting thing is the first link in the answer.
Basically you need to use the JNI wrapper to communicate with Java classes directly, because Delphi doesn't expose the functionality needed here - at least I'm not aware of anything.