相关疑难解决方法(0)

如何在Android中读取彩信数据?

我想读取MMS数据,我已经看到了mmssms.db存储mms条目的部分表; 我正在使用光标,我想知道合适的URI; 我正在使用"content:// mms-sms/conversations"和"地址"(发送到)的列名,"文本"或"主题"和"数据"列图像名称.

我已经看到了mmssms.db部分表的模式和他们的列.

android mms

71
推荐指数
3
解决办法
8万
查看次数

mms发送/回收日期始终是在1970年

从下面的代码我能够获得彩信,但日期总是错误的.可能是我在转换时做错了什么.

   Cursor cursor = activity.getContentResolver().query(Uri.parse("content://mms"),null,null,null,date DESC);
count = cursor.getCount();
if (count > 0) {
  cursor.moveToFirst();
    long messageId = cursor.getLong(0);
   long timestamp = cursor.getLong(2);
   Date date = new Date(timestamp);
   String subject = cursor.getString(3);
Run Code Online (Sandbox Code Playgroud)

}

android

2
推荐指数
1
解决办法
1845
查看次数

如何从content:// mms中检索彩信的日期。

我确实从该链接获得了有关如何检索mms的文本和图像的信息:如何在Android中读取MMS数据?

但是我不确定如何检索发送的彩信的日期。

我知道我必须研究content:// mms而不是content:// mms / part。

这是检索mms文本的方法:

private String getMmsText(String id) {
        Uri partURI = Uri.parse("content://mms/part/" + id);
        InputStream is = null;
        StringBuilder sb = new StringBuilder();
        try {
            is = getContentResolver().openInputStream(partURI);
            if (is != null) {
                InputStreamReader isr = new InputStreamReader(is, "UTF-8");
                BufferedReader reader = new BufferedReader(isr);
                String temp = reader.readLine();
                while (temp != null) {
                    sb.append(temp);
                    temp = reader.readLine();
                }
            }
        } catch (IOException e) {
        } finally {
            if (is != null) {
                try …
Run Code Online (Sandbox Code Playgroud)

android date textview android-sqlite android-mms

1
推荐指数
1
解决办法
1991
查看次数

标签 统计

android ×3

android-mms ×1

android-sqlite ×1

date ×1

mms ×1

textview ×1