2

I followed this to Set/track Status Of a SMS

So in my SMS manager Activity I have added A Status

So Now I want to Know Default Status Codes for

1)SMS sent
2)Generic failure
3)No service
4)Null PDU
5)Radio off
6)SMS delivered and
7)SMS not delivered

I also followed this Regarding Codes of SMS.But I want to Set Status Codes for above all Seven

can any one suggest me on above seven

Don't Be negative
  • 1,215
  • 3
  • 19
  • 46

2 Answers2

1

You can use SmsManager class Constants

int     RESULT_ERROR_GENERIC_FAILURE    
        Generic failure cause
        Constant Value: 1 (0x00000001) 
------------------------------------------------

int     RESULT_ERROR_LIMIT_EXCEEDED    
        Failed because we reached the sending queue limit.
        Constant Value: 5 (0x00000005) 
------------------------------------------------

int     RESULT_ERROR_NO_SERVICE    
        Failed because service is currently unavailable
        Constant Value: 4 (0x00000004)              
------------------------------------------------

int     RESULT_ERROR_NULL_PDU    
        Failed because no pdu provided
        Constant Value: 3 (0x00000003) 
------------------------------------------------

int     RESULT_ERROR_RADIO_OFF    
        Failed because radio was explicitly turned off
        Constant Value: 2 (0x00000002) 
------------------------------------------------

int     RESULT_ERROR_SHORT_CODE_NEVER_ALLOWED    
        Failed because the user has denied this app ever send premium short codes.
        Constant Value: 8 (0x00000008) 
------------------------------------------------

int     RESULT_ERROR_SHORT_CODE_NOT_ALLOWED    
        Failed because user denied the sending of this short code.
        Constant Value: 7 (0x00000007) 
------------------------------------------------

int     STATUS_ON_ICC_FREE    
        Free space (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27).
        Constant Value: 0 (0x00000000) 
------------------------------------------------

int     STATUS_ON_ICC_READ    
        Received and read (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27).
        Constant Value: 1 (0x00000001) 
------------------------------------------------

int     STATUS_ON_ICC_SENT    
        Stored and sent (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27).
        Constant Value: 5 (0x00000005) 
------------------------------------------------

int     STATUS_ON_ICC_UNREAD    
        Received and unread (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27).
        Constant Value: 3 (0x00000003) 
------------------------------------------------

int     STATUS_ON_ICC_UNSENT    
        Stored and unsent (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27). 
        Constant Value: 7 (0x00000007) 
------------------------------------------------
AskNilesh
  • 67,701
  • 16
  • 123
  • 163
1

Do you mean this?

RESULT_ERROR_GENERIC_FAILURE

public static final int RESULT_ERROR_GENERIC_FAILURE

Generic failure cause

Constant Value: 1 (0x00000001)

3)RESULT_ERROR_NO_SERVICE

public static final int RESULT_ERROR_NO_SERVICE

Failed because service is currently unavailable

Constant Value: 4 (0x00000004)

4)RESULT_ERROR_NULL_PDU

public static final int RESULT_ERROR_NULL_PDU

Failed because no pdu provided

Constant Value: 3 (0x00000003)

5)RESULT_ERROR_RADIO_OFF

public static final int RESULT_ERROR_RADIO_OFF

Failed because radio was explicitly turned off

Constant Value: 2 (0x00000002)

but for items:1,6,7 I could not find anything even in Android developer document , I think you should use the result_Ok in broadcast receiver for sending SMS message and broadcast receiver for delivering SMS message,I hope I could help you.

Fereshteh Naji
  • 104
  • 1
  • 11
  • So only Single Digit codes...? what about other Like Sent, delivered .. and over here its different https://www.plivo.com/blog/introducing-sms-error-codes/ – Don't Be negative Jun 19 '18 at 06:23
  • Be careful ,That link is different because they have own SMS API Platform and its diferent from android.telephony.SmsManager. – Fereshteh Naji Jun 19 '18 at 06:28
  • I updated my answer and I think there is no code for these – Fereshteh Naji Jun 19 '18 at 07:05
  • ok thanks for Answer but I am thinking like for Http if it fails 404, success 200 etc.. like that for SMS manager also some kind of Codes... for all above Status.. I can Use those Constant Values but.. I want to Set the Exact or Default SMS Status for All... Not only Android for all Default Status will be Same I want to set them – Don't Be negative Jun 19 '18 at 07:08
  • I know your mean and I will search for that, if I find something, I will comment here. – Fereshteh Naji Jun 19 '18 at 07:15
  • Thanks If you find please post here – Don't Be negative Jun 19 '18 at 07:16