androidmms数据库(android mms)

软件开发 20
今天给各位分享androidmms数据库的知识,其中也会对android mms进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!Android的信息应用中mmsms.db、telephony.db、HbpcdLookup.db的作用分别是什么? 首先明了未接信息的数据库的位置在系统/data/data/com.android.providers.telephony/databases/mmssms.db 包下。

今天给各位分享androidmms数据库的知识,其中也会对android mms进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

Android的信息应用中mmsms.db、telephony.db、HbpcdLookup.db的作用分别是什么?

首先明了未接信息的数据库的位置在系统

/data/data/com.android.providers.telephony/databases/mmssms.db 包下。

希望大家能够结合源码中的

1. Telephony.java (主要讲这些表里有哪些字段)

2. MmsSmsProvider.java (ContentProvider被重写)

3. MmsProvider.java (ContentProvider被重写)

4. SmsProvider.java (ContentProvider被重写)

5. Conversation.java 描述 mmssms数据库的Threads表

前一段时间在开发项目时,遇到这样的需求,要求将 未接短信,未接彩信的信息显示在Widget上。当我们查询mmssms.db数据库时,这其中涉及到以下几张表:

1. threads表

2. 存放短信的表(sms表)

3. 存放彩信的表(pdu表,part表)

4. 存放phone number的表( Canonical_address表)

能否将未接短信,彩信信息直接显示在Widget上,关键是必须要搞清出这4张表之间的表关系。根据我的编码经验,先抛砖引玉地在这里讲解出我的理解…

对于这几张表,我只简单地列出关键字段,省略部分均用(….)代替。

以下的 ”信息” 指代(mms,sms)

具体的内容你可以看看原文啊:

怎样取得android短信数据库中发件人收件人的名字

短信数据库中不会存储姓名,只会存储recipient的号码。

thread表中的recipient_ids字段标示该会话有哪些收件人,收件人/发件人的具体信息会存放在canonical_addresses表中。

根据号码查询联系人数据库,即可获取收件人的姓名等信息

联系人的查询方法请参照 Contact.java 中的getContactInfoForPhoneNumber(String number)

如何使用adb命令查看android中的数据库

1,进入到控制台中,输入adb shell,进入到命令模式的环境中

2,输入:cd /data/data/

3, 选择你所在的数据库文件,比如我的com.android.homework, 输入命令:cd com.android.homework

4, 可以使用ls -l 命令查看当前目录中的文件

5,输入: cd databases 进入到数据库文件中

6, ls -l 显示你数据库中你建立的数据库

7, sqlite3 info.db 进入到你选择的数据库中

8, .tables :查看你建的表

9, select * from table_name;s 可以查看整个表的信息

10, 使用其他的SQL语句可以进一步对表进行操作,注意SQL语句必须用分号(;)结尾

android mms stability 数据库异常怎么办

先来看看Mms相关表格

pdu :存储彩信的基本信息,一条mms在pdu表中由一条数据项表示

addr:关于收件人的表,群发彩信时收件人地址就存在这里

part:彩信的每个媒体文件(比如彩信有多少个音频,图片或视频)

drm: 彩信中媒体文件权限信息

rate:传送速度相关的信息

MMS/SMS相关表格关系

threads _id主键;recipient_ids关联cannoical_address的_id;

sms _id主键;thread_id关联thread表的_id;person关联Contact中的id;

pdu _id主键;thread_id关联thread表的_id;

part _id主键;mid关联pdu表的_id;

addr _id主键;msg_id关联pdu表的_id;contact_id关联Contact中的id;

cannoical_address表与addr都是联系人相关表格,区别在于cannoical_address作用是用来为threads提供支持,不同的address对应不同的threads;而addr表是用来为Mms提供支持的,包括Mms中BCC、CC,FROM,TO的相关联系人都在这里;

[java] view plaincopy

private void createMmsTables(SQLiteDatabase db) {

// N.B.: Whenever the columns here are changed, the columns in

// {@ref MmsSmsProvider} must be changed to match.

db.execSQL("CREATE TABLE " + MmsProvider.TABLE_PDU + " (" +

Mms._ID + " INTEGER PRIMARY KEY," +

Mms.THREAD_ID + " INTEGER," +

Mms.DATE + " INTEGER," +

Mms.DATE_SENT + " INTEGER DEFAULT 0," +

Mms.MESSAGE_BOX + " INTEGER," +

Mms.READ + " INTEGER DEFAULT 0," +

Mms.MESSAGE_ID + " TEXT," +

Mms.SUBJECT + " TEXT," +

Mms.SUBJECT_CHARSET + " INTEGER," +

Mms.CONTENT_TYPE + " TEXT," +

Mms.CONTENT_LOCATION + " TEXT," +

Mms.EXPIRY + " INTEGER," +

Mms.MESSAGE_CLASS + " TEXT," +

Mms.MESSAGE_TYPE + " INTEGER," +

Mms.MMS_VERSION + " INTEGER," +

Mms.MESSAGE_SIZE + " INTEGER," +

Mms.PRIORITY + " INTEGER," +

Mms.READ_REPORT + " INTEGER," +

Mms.REPORT_ALLOWED + " INTEGER," +

Mms.RESPONSE_STATUS + " INTEGER," +

Mms.STATUS + " INTEGER," +

Mms.TRANSACTION_ID + " TEXT," +

Mms.RETRIEVE_STATUS + " INTEGER," +

Mms.RETRIEVE_TEXT + " TEXT," +

Mms.RETRIEVE_TEXT_CHARSET + " INTEGER," +

Mms.READ_STATUS + " INTEGER," +

Mms.CONTENT_CLASS + " INTEGER," +

Mms.RESPONSE_TEXT + " TEXT," +

Mms.DELIVERY_TIME + " INTEGER," +

Mms.DELIVERY_REPORT + " INTEGER," +

Mms.LOCKED + " INTEGER DEFAULT 0," +

Mms.SEEN + " INTEGER DEFAULT 0" +

");");

db.execSQL("CREATE TABLE " + MmsProvider.TABLE_ADDR + " (" +

Addr._ID + " INTEGER PRIMARY KEY," +

Addr.MSG_ID + " INTEGER," +

Addr.CONTACT_ID + " INTEGER," +

Addr.ADDRESS + " TEXT," +

Addr.TYPE + " INTEGER," +

Addr.CHARSET + " INTEGER);");

db.execSQL("CREATE TABLE " + MmsProvider.TABLE_PART + " (" +

Part._ID + " INTEGER PRIMARY KEY," +

Part.MSG_ID + " INTEGER," +

Part.SEQ + " INTEGER DEFAULT 0," +

Part.CONTENT_TYPE + " TEXT," +

Part.NAME + " TEXT," +

Part.CHARSET + " INTEGER," +

Part.CONTENT_DISPOSITION + " TEXT," +

Part.FILENAME + " TEXT," +

Part.CONTENT_ID + " TEXT," +

Part.CONTENT_LOCATION + " TEXT," +

Part.CT_START + " INTEGER," +

Part.CT_TYPE + " TEXT," +

Part._DATA + " TEXT," +

Part.TEXT + " TEXT);");

db.execSQL("CREATE TABLE " + MmsProvider.TABLE_RATE + " (" +

Rate.SENT_TIME + " INTEGER);");

db.execSQL("CREATE TABLE " + MmsProvider.TABLE_DRM + " (" +

BaseColumns._ID + " INTEGER PRIMARY KEY," +

"_data TEXT);");

}

数据项的意义,可以参考android.provider.Telephony

[java] view plaincopy

/**

* Base columns for tables that contain MMSs.

*/

public interface BaseMmsColumns extends BaseColumns {

public static final int MESSAGE_BOX_ALL = 0;

public static final int MESSAGE_BOX_INBOX = 1;

public static final int MESSAGE_BOX_SENT = 2;

public static final int MESSAGE_BOX_DRAFTS = 3;

public static final int MESSAGE_BOX_OUTBOX = 4;

/**

* The date the message was received.

* PType: INTEGER (long)/P

*/

public static final String DATE = "date";

/**

* The date the message was sent.

* PType: INTEGER (long)/P

*/

public static final String DATE_SENT = "date_sent";

/**

* The box which the message belong to, for example, MESSAGE_BOX_INBOX.

* PType: INTEGER/P

*/

public static final String MESSAGE_BOX = "msg_box";

/**

* Has the message been read.

* PType: INTEGER (boolean)/P

*/

public static final String READ = "read";

/**

* Indicates whether this message has been seen by the user. The "seen" flag will be

* used to figure out whether we need to throw up a statusbar notification or not.

*/

public static final String SEEN = "seen";

/**

* The Message-ID of the message.

* PType: TEXT/P

*/

public static final String MESSAGE_ID = "m_id";

/**

* The subject of the message, if present.

* PType: TEXT/P

*/

public static final String SUBJECT = "sub";

/**

* The character set of the subject, if present.

* PType: INTEGER/P

*/

关于androidmms数据库和android mms的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

androidmms数据库 androidmms短信发送
扫码二维码