How to send MMS without prompting to send it via gmail ,whatsapp or something else ?

StackOverflow https://stackoverflow.com/questions/21670947

  •  09-10-2022
  •  | 
  •  

Question

When I am Using this code to send mms to specific user it shows me popup to send it via gmail,whatsapp,gtalk,message and etc. But in my case I just want to send that image as an mms to specific number that i will define in address field whithout showing any popup can any body tell me How to do this ? I googled for this and find lot of stuff on it.

Here is my code*strong text*

public void sendData(int num){
    String fileString = "..."; //put the location of the file here
    Intent mmsIntent = new Intent(Intent.ACTION_SEND);
    mmsIntent.putExtra("sms_body", "text");
    mmsIntent.putExtra("address", num);
    mmsIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(fileString)));
    msIntent.setType("image/jpeg");
    startActivity(Intent.createChooser(mmsIntent, "Send"));

}
Was it helpful?

Solution

Using an intent (like you did) is the preferred way because it's easy to implement and let the user choose his favorite app for the task of sending the MMS.

That being said you can still implement yourself the operation and send the MMS programmatically from your app by crafting and sending the appropriate HTTP request.

The following answer will provide you all the information you need: How to send image via MMS in Android?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top