ImageVerifierCode 换一换
格式:DOCX , 页数:27 ,大小:25.07KB ,
资源ID:17014524      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/17014524.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(MMS发送流程代码版androidWord格式文档下载.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

MMS发送流程代码版androidWord格式文档下载.docx

1、 return; boolean isMms = mWorkingMessage.requiresMms(); /是否需要以彩信形式发送 if (mRecipientsEditor.hasInvalidRecipient(isMms) /是否含有不合法的收件人 if (mRecipientsEditor.hasValidRecipient(isMms) /有合法的和不合法的,弹出尝试发送对话框 String title = getResourcesString(R.string.has_invalid_recipient, mRecipientsEditor.formatInvalidNumb

2、ers(isMms); new AlertDialog.Builder(this) .setIcon(android.R.drawable.ic_dialog_alert) .setTitle(title) .setMessage(R.string.invalid_recipient_message) .setPositiveButton(R.string.try_to_send, newSendIgnoreInvalidRecipientListener() .setNegativeButton(R.string.no, new CancelSendingListener() .show()

3、; else /如果全是不合法的联系人,提示不能发送信息 .setTitle(R.string.cannot_send_message) .setMessage(R.string.cannot_send_message_reason) .setPositiveButton(R.string.yes, new CancelSendingListener() else /判断收件人没有问题,接着发送信息 -3. src/android/mms/ui/poseMessageActivity.javaprivate void sendMessage(boolean bCheckEcmMode) Log

4、.v(TAG, sendMessage); if (bCheckEcmMode) / TODO: expose this in telephony layer for SDK build String inEcm = SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE); /判断是否处于紧急拨号模式,得到的inEcm一般为空inEcm = + inEcm); if (Boolean.parseBoolean(inEcm) try startActivityForResult( new Intent(TelephonyInte

5、nts.ACTION_SHOW_NOTICE_ECM_BLOCK_OTHERS,null), REQUEST_CODE_ECM_EXIT_DIALOG); catch (ActivityNotFoundException e) / continue to send message Log.e(TAG, Cannot find EmergencyCallbackModeExitDialog, e);mSendingMessage) / send can change the recipients. Make sure we remove the listeners firstand then a

6、dd / them back once the recipient list has settled. removeRecipientsListeners(); /取消对收件人的监听 mWorkingMessage.send(); /发送信息- mSentMessage = true; mSendingMessage = true; addRecipientsListeners(); /重新添加收件人监听 / But bail out if we are supposed to exit after the message is sent. if (mExitOnSent) /如果mExitO

7、nSent为true,信息发送完成后退出Activity finish();4. src/android/mms/data/WorkingMessage.java/* * Send this message over the network. Will call back with onMessageSent() once * it has been dispatched to the telephonystack. This WorkingMessage object is * no longer useful after this method hasbeen called. */ pub

8、lic void send() if (Log.isLoggable(LogTag.TRANSACTION, Log.VERBOSE) LogTag.debug(send / Get ready to write to disk. prepareForSave(true /* notify */);/主要做一下同步收件人和WorkingMessage,彩信时在准备其他一些东西 / We need the recipient list for both SMS and MMS. final Conversation conv = mConversation; String msgTxt = mT

9、ext.toString();msgText = + msgTxt); if (requiresMms()| addressContainsEmailToMms(conv, msgTxt) / Make local copies of the bits we need for sending a message, / because we will be doing it off of the main thread, which will / immediately continue on to resetting some of this state. final Uri mmsUri =

10、 mMessageUri; /如果第一次发送,此时mmsUri为null,如果是重发,则是草稿箱的地址 mMessageUri =content:/mms/drafts/1 final PduPersister persister = PduPersister.getPduPersister(mContext); final SlideshowModel slideshow = mSlideshow; final SendReq sendReq = makeSendReq(conv,mSubject); / Do the dirty work of sending the message of

11、f of the main UI thread. new Thread(new Runnable() public void run() / Make sure the text in slide 0 is no longer holding onto a reference to / the text in the message text box. slideshow.prepareForSend(); sendMmsWorker(conv, mmsUri, persister, slideshow, sendReq); ).start(); else / Same rules apply

12、 as above. final String msgText = mText.toString();/取出短消息 + msgText); preSendSmsWorker(conv, msgText);/发送信息- / update the Recipient cache with the new to address, if its different RecipientIdCache.updateNumbers(conv.getThreadId(),conv.getRecipients(); / Mark the message as discarded because it is of

13、f the marketafter being sent. mDiscarded = true;5. src/android/mms/data/WorkingMessage.javaprivate void sendMmsWorker(Conversation conv, Uri mmsUri, PduPersisterpersister, SlideshowModel slideshow, SendReq sendReq) sendMmsWorker / If user tries to send the message, its a signal the inputtedtext is w

14、hat they wanted. UserHappinessSignals.userAcceptedImeText(mContext); / First make sure we dont have too many outstanding unsent message. Cursor cursor = null; cursor = SqliteWrapper.query(mContext, mContentResolver, Mms.Outbox.CONTENT_URI,MMS_OUTBOX_PROJECTION, null, null, null); if (cursor != null)

15、 /如果MMS_OUTBOX里有未发送的彩信,并且总的大小已经超过了彩信的最大限制,则取消此次发送,并存入草稿箱query Mms.Outbox.CONTENT_URI is not empty long maxMessageSize = MmsConfig.getMaxSizeScaleForPendingMmsAllowed()* MmsConfig.getMaxMessageSize();MmsConfig.getMaxSizeScaleForPendingMmsAllowed() = + MmsConfig.getMaxSizeScaleForPendingMmsAllowed();M

16、msConfig.getMaxMessageSize()() = + MmsConfig.getMaxMessageSize(); long totalPendingSize = 0; while (cursor.moveToNext() totalPendingSize +=cursor.getLong(MMS_MESSAGE_SIZE_INDEX);totalPendingSize = + totalPendingSize); if (totalPendingSize = maxMessageSize) unDiscard(); / itwasnt successfully sent. A

17、llow it to be saved as a draft. mStatusListener.onMaxPendingMessagesReached(); elsequery Mms.Outbox.CONTENT_URI is empty finally = null) cursor.close(); mStatusListener.onPreMessageSent(); / Make sure we are still using the correct thread ID for our / recipient set. long threadId = conv.ensureThread

18、Id(); if (Log.isLoggable(LogTag.APP, Log.VERBOSE) sendMmsWorker: update draft MMS message + mmsUri); if (mmsUri = null) /如果是首次发送,先把彩信保存入草稿箱 / Create a new MMS message if one hasnt been made yet.mmsUri = null and startcreateDraftMmsMessage mmsUri = createDraftMmsMessage(persister,sendReq, slideshow);

19、 else / Otherwise, sync the MMS message in progress to disk.mmsUri = updateDraftMmsMessage updateDraftMmsMessage(mmsUri,persister, slideshow, sendReq); / Be paranoid and clean any draft SMS up. deleteDraftSmsMessage(threadId); / Resize all the resizeable attachments (e.g. pictures) to fit / in the r

20、emaining space in the slideshow. int error = 0; slideshow.finalResize(mmsUri); catch (ExceedMessageSizeException e1) error = MESSAGE_SIZE_EXCEEDED; catch (MmsException e1) error = UNKNOWN_ERROR; if (error != 0) markMmsMessageWithError(mmsUri); mStatusListener.onAttachmentError(error); MessageSender

21、sender = new MmsMessageSender(mContext, mmsUri, slideshow.getCurrentMessageSize();sender.sendMessage(threadId) / The message was sent through SMS protocol, we should / delete the copy which was previously saved in MMS drafts. SqliteWrapper.delete(mContext, mContentResolver, mmsUri, null, null); / Make sure this thread isnt over the limits in message count

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1