Implementation of Android FIH-MMS

Source: Internet
Author: User
Tags vcard

1. Save the received MMS
The received MMS will be saved by calling pdupersister: persist (...) in the retrievetransaction: Run () function.

2. Implementation of vCard and vcalendar
A. Receive
When the received MMS is saved, it will be stored in the pdupersister: persist (..) finally, call checkhaveotherattachment (..), set MMs in dB. other_attachment indicates the attachment type. If it is vCard or vcalendar, its value is MMs. other_attachment_vcard_unselect;
The MMS. other_attachment In the DB is used to identify whether the MMS contains the two things, thus determining the UI display;
When accessing part of vCard and vcalendar, You can traverse all the parts of the mms uri in the database, whether the content type of the comparator is "text/X-vCard", "text/X-vcalendar", or "application/Oct-stream" to find the part, if this method is used for forwarding (composemessageactivity: importvcardvcalendar ());
B. Edit

When you edit a vCard, the data is stored in the database as a part and inserted into the "first slide". For details, see composemessageactivity: addvcard ();
When a PDU is generated, vCard and vcalendar will be stored as parts in the same way as other models. For details, see slideshowmodel: makepdubody (..);

3. loading the list of threads and message
A. Thread
Conversationlist: startasyncquery (), read the list from the database;
Threadlistqueryhandler: onquerycomplete (...), get the query result cursor;
Conversationlistadapter: BindView (...), parse cursor, and assign data to each thread item;
B. Message
Conversationlist: onlistitemclick (...), triggering event of loading message list.
Composemessageactivity: startmsglistquery (), read the list from the database;
Messagelistadapter: BindView (..);Messageitem: messageitem (...), parse cursor, and assign data to each message item;4. Implementation of recipientseditor.
A. The matching principle is automatically listed after two or more characters are entered in the recipient column.
Character Change --> trigger the text changed event -->... --> recipientsadapter: runqueryonbackgroundthread (..) -->... --> autocompletetextview: onfiltercomplete (..) --> autocompletetextview: showdropdown () --> recipientsadapter: BindView (..)
Here, the function runqueryonbackgroundthread is to query the qualified recipient number or email address from the database; BindView is to insert the queried items into the listview as items.
B ,....5. Send MMs.
Take sending in composemessageactivity as an example.
Save it as a draft --> call composemessageactivity: sendmmsworker (...) --> mmsmessagesender: sendmessage (...) --> set the time and so on. Move MMs to out box --> requestservice transactionservice: send_transaction --> transactionservice: servicehandler: handlemessage (...) -->... --> sendtransaction: Run () --> transaction: sendpdu (...) --> httputils. httpconnection (...) --> androidhttpclient: Execute (...).
Androidhttpclient: Execute performs the real sending operation.6 ,...
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.