Example usage for android.telephony SmsManager STATUS_ON_ICC_READ

List of usage examples for android.telephony SmsManager STATUS_ON_ICC_READ

Introduction

In this page you can find the example usage for android.telephony SmsManager STATUS_ON_ICC_READ.

Prototype

int STATUS_ON_ICC_READ

To view the source code for android.telephony SmsManager STATUS_ON_ICC_READ.

Click Source Link

Document

Received and read (TS 51.011 10.5.3 / 3GPP2 C.S0023 3.4.27).

Usage

From source file:com.polyvi.xface.extension.messaging.XMessagingExt.java

/**
 * ?json//from w  w  w .  j  a v  a2s .  c om
 * */
private JSONObject buildSmsJsonObj(SmsMessage msg) throws JSONException {

    JSONObject msgJsonObj = new JSONObject();
    msgJsonObj.put("msgId", "");
    msgJsonObj.put("subject", msg.getPseudoSubject());
    msgJsonObj.put("body", msg.getDisplayMessageBody());
    msgJsonObj.put("destinationAddresses", "");
    msgJsonObj.put("originatingAddress", msg.getDisplayOriginatingAddress());
    msgJsonObj.put("messageType", "SMS");
    boolean isRead = false;
    if (SmsManager.STATUS_ON_ICC_READ == msg.getStatusOnIcc()) {
        isRead = true;
    }
    msgJsonObj.put("isRead", isRead);
    msgJsonObj.put("date", msg.getTimestampMillis());
    return msgJsonObj;
}