Joke Collection Website - Blessing messages - How to write android app with eclipse to realize the function of sending short messages?

How to write android app with eclipse to realize the function of sending short messages?

Write down the general steps for you:

1. Add the right to call SMS function in the configuration file of android project:

& lt permission? Android:name = " Android . permission . send _ SMS " & gt; & lt/uses-permission & gt;

& lt permission? Android:name = " Android . permission . read _ SMS " & gt; & lt/uses-permission & gt;

& lt permission? Android:name = " Android . permission . receive _ SMS " & gt; & lt/uses-permission & gt; 2. The main code fragment:

Public? Class? testSms? Extension? Activities? {

...

Private? Invalid? Send 1 (string? Telephone? String? Message) {

Pending content? Pi? =? PendingIntent.getActivity(this,? 0,? New? Intention (this,? testSms.class),? 0);

SmsManager? Text messages? =? SMS manager . get default();

Sms.sendTextMessage (phone, null,? News? Pi? null);

}

} parameter: phone: mobile phone number

? Message: SMS content