File:///F:/workspace3/Android_ver2.5/src/cn/szy/com/MainActivity.java
Package Cn.szy.com;import Java.util.arraylist;import Android.app.activity;import android.os.bundle;import Android.telephony.smsmanager;import Android.view.view;import Android.widget.button;import Android.widget.EditText Import Android.widget.toast;public class Mainactivity extends activity {/** Called when the activity is first created . */private Button button;private EditText edittext,number; @Override public void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate); Setcontentview (R.layout.main); Button = (button) This.findviewbyid (R.id.button); Number = (EditText) This.findviewbyid (r.id.num); EditText = (edittext) This.findviewbyid (r.id.content); public void Opentall (View v) {String num = Number.gettext (). toString (); String content = Edittext.gettext (). toString (); Smsmanager manager = Smsmanager.getdefault (); arraylist<string> texts = manager.dividemessage (content); for (String text:texts) {Manager.sendtExtmessage (num, null, text, NULL, NULL);} Toast.maketext (Mainactivity.this, "Send Success", Toast.length_long). Show ();}}
Androidmanifest.xml
<uses-permission android:name= "Android.permission.SEND_SMS"/>
Java-android SMS Send