当前位置: 首页>>代码示例>>Java>>正文


Java Sms.MESSAGE_TYPE_SENT属性代码示例

本文整理汇总了Java中android.provider.Telephony.Sms.MESSAGE_TYPE_SENT属性的典型用法代码示例。如果您正苦于以下问题:Java Sms.MESSAGE_TYPE_SENT属性的具体用法?Java Sms.MESSAGE_TYPE_SENT怎么用?Java Sms.MESSAGE_TYPE_SENT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.provider.Telephony.Sms的用法示例。


在下文中一共展示了Sms.MESSAGE_TYPE_SENT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSmsReportItems

private List<DeliveryReportItem> getSmsReportItems() {
    String selection = "_id = " + mMessageId;
    Cursor c = SqliteWrapper.query(mContext, mContext.getContentResolver(), Sms.CONTENT_URI,
                          SMS_REPORT_STATUS_PROJECTION, selection, null, null);
    if (c == null) {
        return null;
    }

    try {
        if (c.getCount() <= 0) {
            return null;
        }

        List<DeliveryReportItem> items = new ArrayList<>();
        while (c.moveToNext()) {
            // For sent messages with delivery reports, we stick the delivery time in the
            // date_sent column (see MessageStatusReceiver).
            String deliveryDateString = null;
            long deliveryDate = c.getLong(COLUMN_DATE_SENT);
            int messageType = c.getInt(COLUMN_MESSAGE_TYPE);
            if (messageType == Sms.MESSAGE_TYPE_SENT && deliveryDate > 0) {
                deliveryDateString = mContext.getString(R.string.delivered_label) +
                        MessageUtils.formatTimeStampString(mContext, deliveryDate, true);
            }

            items.add(new DeliveryReportItem(
                            mContext.getString(R.string.recipient_label) + c.getString(COLUMN_RECIPIENT),
                            mContext.getString(R.string.status_label) +
                                    getSmsStatusText(c.getInt(COLUMN_DELIVERY_STATUS)),
                                    deliveryDateString));
        }
        return items;
    } finally {
        c.close();
    }
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:36,代码来源:DeliveryReportHelper.java

示例2: getSmsReportItems

private List<DeliveryReportItem> getSmsReportItems() {
    String selection = "_id = " + mMessageId;
    Cursor c = SqliteWrapper.query(this, getContentResolver(), Sms.CONTENT_URI,
                          SMS_REPORT_STATUS_PROJECTION, selection, null, null);
    if (c == null) {
        return null;
    }

    try {
        if (c.getCount() <= 0) {
            return null;
        }

        List<DeliveryReportItem> items = new ArrayList<DeliveryReportItem>();
        while (c.moveToNext()) {
            // For sent messages with delivery reports, we stick the delivery time in the
            // date_sent column (see MessageStatusReceiver).
            String deliveryDateString = null;
            long deliveryDate = c.getLong(COLUMN_DATE_SENT);
            int messageType = c.getInt(COLUMN_MESSAGE_TYPE);
            if (messageType == Sms.MESSAGE_TYPE_SENT && deliveryDate > 0) {
                deliveryDateString = getString(R.string.delivered_label) +
                        MessageUtils.formatTimeStampString(this,
                                deliveryDate, true);
            }

            items.add(new DeliveryReportItem(
                            getString(R.string.recipient_label) + c.getString(COLUMN_RECIPIENT),
                            getString(R.string.status_label) +
                                    getSmsStatusText(c.getInt(COLUMN_DELIVERY_STATUS)),
                                    deliveryDateString));
        }
        return items;
    } finally {
        c.close();
    }
}
 
开发者ID:CommonQ,项目名称:sms_DualCard,代码行数:37,代码来源:DeliveryReportActivity.java

示例3: toRealType

public String toRealType(int type) {
    switch (type) {
        case Sms.MESSAGE_TYPE_INBOX:
            return INBOX_MESSAGE;
        case Sms.MESSAGE_TYPE_OUTBOX:
            return  OUTBOX_MESSAGE;
        case Sms.MESSAGE_TYPE_DRAFT:
            return DRAFT_MESSAGE;
        case Sms.MESSAGE_TYPE_SENT:
            return SENT_MESSAGE;
        default:
            return "";
    }
}
 
开发者ID:PhoneRemoteControl,项目名称:OrbitCat,代码行数:14,代码来源:Message.java

示例4: getTextMessageDetails

private static String getTextMessageDetails(Context context, Cursor cursor) {
    Log.d(TAG, "getTextMessageDetails");

    StringBuilder details = new StringBuilder();
    Resources res = context.getResources();

    // Message Type: Text message.
    details.append(res.getString(R.string.message_type_label));
    details.append(res.getString(R.string.text_message));

    // Address: ***
    details.append("\n\n");
    int smsType = cursor.getInt(MessageColumns.COLUMN_SMS_TYPE);
    if (SmsHelper.isOutgoingFolder(smsType)) {
        details.append(res.getString(R.string.to_address_label));
    } else {
        details.append(res.getString(R.string.from_label));
    }
    details.append(cursor.getString(MessageColumns.COLUMN_SMS_ADDRESS));

    // Sent: ***
    if (smsType == Sms.MESSAGE_TYPE_INBOX) {
        long date_sent = cursor.getLong(MessageColumns.COLUMN_SMS_DATE_SENT);
        if (date_sent > 0) {
            details.append("\n\n");
            details.append(res.getString(R.string.sent_label));
            details.append(MessageUtils.formatTimeStampString(context, date_sent, true));
        }
    }

    // Received: ***
    details.append("\n\n");
    if (smsType == Sms.MESSAGE_TYPE_DRAFT) {
        details.append(res.getString(R.string.saved_label));
    } else if (smsType == Sms.MESSAGE_TYPE_INBOX) {
        details.append(res.getString(R.string.received_label));
    } else {
        details.append(res.getString(R.string.sent_label));
    }

    long date = cursor.getLong(MessageColumns.COLUMN_SMS_DATE);
    details.append(MessageUtils.formatTimeStampString(context, date, true));

    // Delivered: ***
    if (smsType == Sms.MESSAGE_TYPE_SENT) {
        // For sent messages with delivery reports, we stick the delivery time in the
        // date_sent column (see MessageStatusReceiver).
        long dateDelivered = cursor.getLong(MessageColumns.COLUMN_SMS_DATE_SENT);
        if (dateDelivered > 0) {
            details.append("\n\n");
            details.append(res.getString(R.string.delivered_label));
            details.append(MessageUtils.formatTimeStampString(context, dateDelivered, true));
        }
    }

    // Error code: ***
    int errorCode = cursor.getInt(MessageColumns.COLUMN_SMS_ERROR_CODE);
    if (errorCode != 0) {
        details.append("\n\n")
                .append(res.getString(R.string.error_code_label))
                .append(errorCode);
    }

    return details.toString();
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:65,代码来源:MessageUtils.java

示例5: getTextMessageDetails

private static String getTextMessageDetails(Context context, Cursor cursor) {
    Log.d(TAG, "getTextMessageDetails");

    StringBuilder details = new StringBuilder();
    Resources res = context.getResources();

    // Message Type: Text message.
    details.append(res.getString(R.string.message_type_label));
    details.append(res.getString(R.string.text_message));

    // Address: ***
    details.append('\n');
    int smsType = cursor.getInt(MessageListAdapter.COLUMN_SMS_TYPE);
    if (Sms.isOutgoingFolder(smsType)) {
        details.append(res.getString(R.string.to_address_label));
    } else {
        details.append(res.getString(R.string.from_label));
    }
    details.append(cursor.getString(MessageListAdapter.COLUMN_SMS_ADDRESS));

    // Sent: ***
    if (smsType == Sms.MESSAGE_TYPE_INBOX) {
        long date_sent = cursor.getLong(MessageListAdapter.COLUMN_SMS_DATE_SENT);
        if (date_sent > 0) {
            details.append('\n');
            details.append(res.getString(R.string.sent_label));
            details.append(MessageUtils.formatTimeStampString(context, date_sent, true));
        }
    }

    // Received: ***
    details.append('\n');
    if (smsType == Sms.MESSAGE_TYPE_DRAFT) {
        details.append(res.getString(R.string.saved_label));
    } else if (smsType == Sms.MESSAGE_TYPE_INBOX) {
        details.append(res.getString(R.string.received_label));
    } else {
        details.append(res.getString(R.string.sent_label));
    }

    long date = cursor.getLong(MessageListAdapter.COLUMN_SMS_DATE);
    details.append(MessageUtils.formatTimeStampString(context, date, true));

    // Delivered: ***
    if (smsType == Sms.MESSAGE_TYPE_SENT) {
        // For sent messages with delivery reports, we stick the delivery time in the
        // date_sent column (see MessageStatusReceiver).
        long dateDelivered = cursor.getLong(MessageListAdapter.COLUMN_SMS_DATE_SENT);
        if (dateDelivered > 0) {
            details.append('\n');
            details.append(res.getString(R.string.delivered_label));
            details.append(MessageUtils.formatTimeStampString(context, dateDelivered, true));
        }
    }

    // Error code: ***
    int errorCode = cursor.getInt(MessageListAdapter.COLUMN_SMS_ERROR_CODE);
    if (errorCode != 0) {
        details.append('\n')
            .append(res.getString(R.string.error_code_label))
            .append(errorCode);
    }

    return details.toString();
}
 
开发者ID:slvn,项目名称:android-aosp-mms,代码行数:65,代码来源:MessageUtils.java


注:本文中的android.provider.Telephony.Sms.MESSAGE_TYPE_SENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。