- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
模拟器互发短信息(The simulator sends messages to each other)
模拟器互发短信息(The simulator sends messages to each other)
Purpose: use simulator to send short messages to each other, such as 5554 and 5556, sending short messages to each other
Key code:
Send SMS code:
Java code
Package cc.androidos.sms;
Import android.app.Activity;
Import android.app.PendingIntent;
Import android.content.Intent;
Import android.os.Bundle;
Import android.telephony.gsm.SmsManager;
Import android.util.Log;
Import android.view.View;
Import android.view.View.OnClickListener;
Import android.widget.Button;
Import android.widget.EditText;
/ * *
*
* @param demo
*: its, own, object.
* @param telNum
*: telephone, number, to, send, to
* @param messageText
*: the, message, need, to, send
* @param sendBtn
*: Button.
*
* /
Public, class, SMSDemo, extends, Activity {
Private static SMSDemo demo;
Private EditText telNum;
Private EditText messageText;
Private Button sendBtn;
/ * *
* override, the, method, onCreate () 1.
Bind the data telnum and messageText.
* 2.set the sendbtns listener.
* /
Public void oncreate (bundle savedinstancestate) {
Super.oncreate (savedinstancestate);
Setcontentview (r.layout.send);
Demo = this;
Telnum = (editext ) findviewbyid (r.id.telnumtext _ send);
MessageText = (editext ) findviewbyid (r.id.message _ copntent _ send);
Sendbtn = (button) findviewbyid (r.id.send _ button _ send);
/ * *
* 1.get the data from the input line. The smsmanager and send 2.call
* the message.
* /
Sendbtn.setonclicklistener (New onclicklistener () {
Public void onclick (view v) {
String telnumstr = telnum.gettext.Tostring () ();
String messagestr = messagetext.gettext.Tostring () ();
If (null. Telnumstr = null. = messagestr) {
Smsmanager smsmgr = smsmanager.getdefault ();
Intent I = new intent (cc.androidos.smsdemo.ignore _ me);
Pendingintent dummyevent = pendingintent.getbroadcast (
Smsdemo.this, 0, 1, 0);
Try {
Smsmgr.
sendtextmessage (telnumstr, null, messagestr,
dummyevent, dummyevent);
} catch (exception e) {
log.e (smssending, sendexception, (e);
}
} else {
您可能关注的文档
- 山东省泰安市宁阳实验中学2013届高三第一次段考生物试题(Shandong city of Tai'an province Ningyang experimental middle school 2013 session of the first three exam papers of Biology).doc
- 岳阳楼的三美(Yueyang Tower beauties).doc
- 岩沥青介绍(Yan Liqing introduction).doc
- 岳阳楼记说课稿(Yueyang Tower notes).doc
- 巨星mtv2002界面和参数设置(Superstar mtv2002 interface and parameter settings).doc
- 左撇子儿童易心理失衡(Left handed children tend to lose their mental balance).doc
- 崀山行程安排(Lang Mountain itinerary).doc
- 已婚女人必看(A married woman must see).doc
- 希腊习语(Greek idioms).doc
- 幕墙基础知识(上)-铝型材(Basic knowledge of curtain wall (Part I) aluminum profile).doc
- 武当武术(Wudang Martial Arts).doc
- 母猪断奶(Sow weaning).doc
- 每句话都可以品半辈子(Each sentence can be worth half a lifetime).doc
- 每天四杯绿茶 让癌症离远点(Four cups of green tea a day to keep the cancer away).doc
- 每年必考的40个病史采集(附诊断(40 year compulsory history (report of diagnosis).doc
- 民爱奉献之白带过多岂能一洗了之(People love dedication leucorrhea too much, how can one wash it).doc
- 民用沼气燃具及其设计(Civilian biogas burner and its design).doc
- 民族团结是各族人民的生命线(National unity is the lifeline of the people of all ethnic groups).doc
- 欧洲心脏病学会(European Society of Cardiology).doc
- 气虚血虚(Qi deficiency and blood deficiency).doc
文档评论(0)