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 ,...