Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Android how to send SMS

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 230
    Comment on it

    For sending SMS in Android, we have two different ways to do so, First is by using Android's built in SMS application and other is by using Android's SMS manager Api.

    Here is how we do that:

    1: By using Android device's built-in SMS application:

    Intent smsIntent = new Intent(Intent.ACTION_VIEW);
    smsIntent.putExtra("sms_body", "default content"); 
    smsIntent.setType("vnd.android-dir/mms-sms");
    startActivity(smsIntent);
    

    2: By using Android'd SmsManager Api:

    SmsManager smsManager = SmsManager.getDefault();
    smsManager.sendTextMessage("phone_number", null, "message content goes here", null, null);
    

    To send SMS in Android, we also need to a permission in AndroidManifest.xml, that is:

    android:name="android.permission.SEND_SMS"

    Hope these simple steps help you :)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: