I am looking for a way to send an sms, which has an image along with the message body to a series of numbers with the help of a for loop. I've figured out a way of automatically sending simple text message to a CSV list of numbers using the below code -
String number = editTextNumber.getText().toString();
String[] numbers = number.split(","); //the number edittext has a csv list of a bunch of no.s
String entrymessage = "some text";
SmsManager mySmsManager = SmsManager.getDefault();
for(int i=0;i<numbers.length;i++){
mySmsManager.sendTextMessage(numbers[i],null, entrymessage, null, null);
}
I just want to send an image alongwith the sms body. I know some devices today still do not support images in sms, so if the image sending fails, my app should just send the text body.
Is it possible to send a locally stored image (e.g. path from my phone - Internal Storage/Download/lion.jpeg
) along with the body? I've read many topics on how to send an MMS in android, but they all are 8-9yrs old - so I am not sure if they still work or are deprecated. I am new to android apps hence I am confused here... Kindly guide me here... Thanks!