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?
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
- Previous article:Credit card deduction failed.
- Next article:Take a piece from the rookie station and send it to the mini refrigerator nine times?
- Related articles
- What does the girl mean by m? How to reply when a girl sends a message?
- When will Dengzhou Sanxian High School start?
- How to write a reason for Tik Tok stores to report malicious orders?
- Will Shanghai send short messages with yellow application code?
- How to reply to the Japanese short message sent by the other party?
- Blessing information of drinking Laba porridge on Laba Festival
Blessing message for drinking Laba porridge on traditional Laba Festival
1, Laba porridge on Laba Festival is cooked with go
- Greetings and words of concern to friends
- Hello, do you know some plots of the TV series "I want to see you"?
- Ask for a translation of a foreign language document ~
- What if the US version of iphone5 can't send text messages?