資源描述:
《安卓CDMA超長短信發(fā)送》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、安卓CDMA超長短信發(fā)送首先調(diào)用mWorkingMessage.send();發(fā)送短信mWorkingMessage.send();不用猜測他是什么你就當(dāng)作是Button的OnClick把mWorkingMessage.send(){if(Log.isLoggable(LogTag.TRANSACTION,Log.VERBOSE)){LogTag.debug("send");}//Getreadytowritetodisk.prepareForSave(true/*notify*/);//WeneedtherecipientlistforbothSMSandMMS.finalConve
2、rsationconv=mConversation;StringmsgTxt=mText.toString();if(requiresMms()
3、
4、addressContainsEmailToMms(conv,msgTxt)){//Makelocalcopiesofthebitsweneedforsendingamessage,//becausewewillbedoingitoffofthemainthread,whichwill//immediatelycontinueontoresettingsomeofthisstate.//使我們的比特的信息需要發(fā)送一個(gè)本地副本,//因?yàn)槲覀儗?/p>
5、做它關(guān)閉了主線程,這將//立即繼續(xù)以這種狀態(tài)重置一些finalUrimmsUri=mMessageUri;finalPduPersisterpersister=PduPersister.getPduPersister(mContext);finalSlideshowModelslideshow=mSlideshow;finalSendReqsendReq=makeSendReq(conv,mSubject);//Makesurethetextinslide0isnolongerholdingontoareferencetothetext//inthemessagetextbox.sli
6、deshow.prepareForSend();//DothedirtyworkofsendingthemessageoffofthemainUIthread.newThread(newRunnable(){publicvoidrun(){sendMmsWorker(conv,mmsUri,persister,slideshow,sendReq);}}).start();}else{//Samerulesapplyasabove.finalStringmsgText=mText.toString();newThread(newRunnable(){publicvoidrun(){sen
7、dSmsWorker(conv,msgText);//抓住這點(diǎn)繼續(xù)追查}}).start();}//updatetheRecipientcachewiththenewtoaddress,ifit'sdifferent更新了新的收件人地址緩存,如果它的不同RecipientIdCache.updateNumbers(conv.getThreadId(),conv.getRecipients());//Markthemessageasdiscardedbecauseitis"offthemarket"afterbeingsent.mDiscarded=true;}//-----------
8、--------------------------------------------------------------------------------------------------------sendSmsWorker(conv,msgText){mStatusListener.onPreMessageSent();//MakesurewearestillusingthecorrectthreadIDforour//recipientset.longthreadId=conv.ensureThreadId();String[]dests=conv.getRecipien
9、ts().getNumbers();//獲取收件人的號(hào)碼try{MessageSendersender=newSmsMessageSender(mContext,dests,msgText,threadId);//構(gòu)造一個(gè)MessageSendersender.sendMessage(threadId);//繼續(xù)追查數(shù)據(jù)是怎么發(fā)送的//Makesurethisthreadisn'toverthelimitsinmessagecountRecyc