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

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

2014-10-27 9213

作为初学者,入门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" />

展开分享
服务
案例
动态
联系
咨询