Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send text message to more than 1 number?

Tags:

android

sms

I am trying to have a list of contact numbers.

I want to know is there a way to send a text message to more than 1 number iprogrammatically in Android?

If so how?

like image 669
coder_For_Life22 Avatar asked Oct 14 '11 19:10

coder_For_Life22


People also ask

How do I send an SMS to many numbers at once?

It’s incredibly easy to send an SMS to many numbers at a time with SimpleTexting. In just a few minutes you can conveniently and effectively communicate with all of your contacts. All you need to do is… 1. Sign up for an account Try our SMS broadcast service for free for 2 weeks. You can test us out by sending a free text message campaign.

How to send text messages to multiple recipients at once?

You can also send text messages to multiple recipients from your Android forum. This requires wireless supported phones. Click on ‘Send an SMS reply to all the recipients and get personal replies. With the advancement in technology, it is now possible to send text messages to multiple recipients at once.

How many people can you text on a text message app?

Most default messaging apps only let you text around 10 people This isn’t a major problem if it’s a group of friends coordinating dinner plans but it quickly becomes one if you want to send one SMS to multiple numbers as a business. There are other benefits of using a paid SMS service to send messages. You can also:

How to send text messages from a cell phone?

Write the numbers in the county’s or city’s local format. For example – 07520633003 Next, add from your contacts and then add from all your lists. Then you need to also add your frequently used numbers. Next, choose the number you want your text to be sent from. Next, type your message in the message box.


2 Answers

You can't do this via Intent, as the android SMS app doesn't allow multiple recipients.

You can try using the SmsManager class.

First of all you need to request the permission android.permission.SEND_SMS in your AndroidManifest.

Then you can do something along these lines.

// you need to import the Sms Manager
import android.telephony.SmsManager;

// fetch the Sms Manager
SmsManager sms = SmsManager.getDefault();

// the message
String message = "Hello";

// the phone numbers we want to send to
String numbers[] = {"555123456789", "555987654321"};

for(String number : numbers) {
  sms.sendTextMessage(number, null, message, null, null);
}


Update: Added how to split a comma-separated string
// string input by a user
String userInput = "122323,12344221,1323442";

// split it between any commas, stripping whitespace afterwards
String numbers[] = userInput.split(", *");
like image 83
Matthew Rudy Avatar answered Oct 20 '22 02:10

Matthew Rudy


for group sms or multiple sms use this

  Intent i = new Intent(android.content.Intent.ACTION_VIEW);
    i.putExtra("address", "987385438; 750313; 971855;84393");
    i.putExtra("sms_body", "Testing you!");
    i.setType("vnd.android-dir/mms-sms");
    startActivity(i);
//use permission: <uses-permission android:name="android.permission.SEND_SMS"/>

you can modify this "9873854; 750313; 971855; 84393" with your contact number

like image 8
Shiv Kumar Avatar answered Oct 20 '22 01:10

Shiv Kumar