十年专注于品牌网站建设 十余年专注于网站建设_小程序开发_APP开发,低调、敢创新、有情怀!
南昌百恒网络微信公众号 扫一扫关注
小程序
tel-icon全国服务热线:400-680-9298,0791-88117053
扫一扫关注百恒网络微信公众号
扫一扫打开百恒网络微信小程序

百恒网络

南昌百恒网络

介绍android中短信发送的实现方法及代码图文结合

百恒网络 2014-10-27 8249

作为初学者,入门android开发,我们首先需要了解常见的android应用,例如,拔打电话,发送短信等诸如此类的功能,由于android系统提供了很完善的函数或接口,这些功能实现起来都比较简单,在此百恒软件开发工程向广大初学者全面介绍短信发送的实现过程及相关代码,希望对广大初学者有所帮助。若在学习过程中遇到代码错误的同行也可以与此代码进行对照,找出错误原因。

1.跟开发WEB程序一样,先做出UI界面,因为这里我们是要实其功能,界面不作过多的美化。代码如下:

Activity_main.xml   
android:id="@+id/tv_input_number"           //这个是提示用户输入电话号码的TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/please_input_number"
android:textSize="20px" />   
android:id="@+id/et_number"                //这个是输入电话号码的文本框
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_input_number"
android:ems="10"
android:inputType="phone" >

android:id="@+id/tv_input_content"          //提示输入内容的文本
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/et_number"
android:layout_below="@+id/et_number"
android:text="@string/please_input_content"
android:textSize="20px"
android:textColor="#333333"
/>   
android:id="@+id/et_content"                 //这是输入文本内容的文本编辑器
android:layout_width="fill_parent"
android:layout_height="wrap_content"android中短信发送
android:layout_below="@+id/tv_input_content"
android:singleLine="true"
android:lines="5"
android:inputType="textMultiLine" />

400-680-9298,0791-88117053
扫一扫关注百恒网络微信公众号
扫一扫打开百恒网络小程序

欢迎您的光顾,我们将竭诚为您服务×

售前咨询 售前咨询
 
售前咨询 售前咨询
 
售前咨询 售前咨询
 
售前咨询 售前咨询
 
售前咨询 售前咨询
 
售后服务 售后服务
 
售后服务 售后服务
 
备案专线 备案专线
 
×