+ Reply to Thread
Results 1 to 2 of 2

Thread: How to send SMS using android API?

  1. #1
    Junior Member
    Join Date
    Aug 2012
    Posts
    15

    How to send SMS using android API?

    I have made a listview for contacts when ever uses click on listitem i am forwarding mobile no to another activity so that i can send a predefined message to specified mobile no.Let me know how to send sms in android.

  2. #2
    Junior Member
    Join Date
    Aug 2012
    Posts
    17
    1.Set the permission in the AndroidManifest XML file to send SMS:

    Code:
    <uses-permission android:name="android.permission.SEND_SMS">
    2. Use the SmsManager.getDefault() static method to get an SMS manager instance:

    Code:
    SmsManager mySMS = SmsManager.getDefault();
    3. Define the destination phone number for the message and message to send. Use the

    Code:
    sendTextMesssage() method to send the SMS to another device:
    String destination = "16501234567";
    String msg = "Sending my first message"; 
    mySMS.sendTextMessage(destination, null, msg, null, null);

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts