smsManager.sendMultipartTextMessage(
mDests[i], mServiceCenter, messages,
sentIntents, deliveryIntents);
In my SmsReceiver (sentIntents) sometimes I receive getResultCode() = 0
.
According to the documentation: http://developer.android.com/reference/android/telephony/SmsManager.html
It means STATUS_ON_ICC_FREE
. But I can't understand what it is.
When it is returned - SMS are not sent.
What does this mean and how to fix it? What is the reason for STATUS_ON_ICC_FREE
?
SMS error code is a number that is sent out whenever there is a problem with the process of sending messages. These sms error codes are like indicating an outcome of what went wrong in the process of sending messages. There are different codes that senders receive when a message fails to be delivered.
Some common reasons why SMS messages may be failing to send: The destination handset is unreachable. The destination phone number does not support Text. The SMS message exceeds the 160 character limit.
You're just comparing result code to the wrong constant. SmsManager.sendMultipartTextMessage
Javadoc clearly states about the possible values returned by the getResultCode()
in the sentIntents
broadcast:
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
In my opinion STATUS_ON_ICC_xxx
constants were added to the public API by mistake since they are used only by hidden methods of the SmsManager class: copyMessageToIcc
, deleteMessageFromIcc
etc.
UPDATE
However this doesn't explain why do you receive 0
from getResultCode()
. As neither of these constant is equal to zero (Activity.RESULT_CANCEL = 0
but there is no mention of it in the SmsManager
javadoc). Quick search through Android Sources also doesn't give any clue were 0
could come from.
One possibility could be that some other application catch the sentIntent
broadcast and call setResultCode
explicitly. However I was sure up to now that it's impossible in Android to prevent the SMS from being sent at the application level.
The javadoc says Free space (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27).
. The 3GPP2 specifications say
I don't know anything about SMS, but from what I understand, this "free space" is opposed to the "used space" (xx1
that actually defines statuses such as 001 received & read ; 011 receveid & to be read ; etc.)
I would says this status does not mean anything...
In the Android code, I have found only one reference to STATUS_ON_ICC_FREE
: deleteMessageFromIcc()
updates the message with this status when the message has successfully been deleted from the SIM card (aka ICC)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With