0
Uri mmsUri = Uri.parse("content://media/external/images/media/1"); 
                Intent intentMMS = new Intent(Intent.ACTION_SEND); 
                intentMMS.putExtra("sms_body", "Hi how are you");
                intentMMS.putExtra(Intent.EXTRA_STREAM, mmsUri); 
                intentMMS.setType("image/png"); 
                startActivity(intentMMS);

I used the above code to create a MMS sending application. But I don't understand how to add this to my code. In this code there is no place to put the sending number.

Can someone help me on this matter???

9T9
  • 698
  • 2
  • 9
  • 22

2 Answers2

1

There is no place to put the phone number because this code is simply going to launch the messaging application with the body filled in and an image attached. It is up to the user to type in the number (or contact name) that they'd like the message to go to.

If you are looking to handle the whole process yourself you are in for some extra work.

the accepted answer on this question: How to send image via MMS in Android? seems to be what you are looking for.

Community
  • 1
  • 1
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
  • 1
    That's right. I was looking for an application like that. But it gives lots of errors and I don't know what are they. Are there any other way to do it? Or a understandable tutorial about it??? I really really need that part.. – 9T9 Mar 13 '12 at 18:21
  • 1
    as far as I know that is the only way to do it. There were apparently some libraries that made the process easier. SendMMS3.zip seems to come up a lot in searchers for this topic. I can't find a place with a live link to it any more though. – FoamyGuy Mar 13 '12 at 18:50
  • Thanks friend...I'll try to do it that way... :) – 9T9 Mar 14 '12 at 03:56
1

Have you tried something like this:

Intent intentMMS  = new Intent(Intent.ACTION_SENDTO);
intentMMS.putExtra("address", "12134567899");
intentMMS.putExtra("sms_body", "See attached picture");

Uri mmsUri = Uri.parse("content://media/external/images/media/1");
intentMMS.putExtra(Intent.EXTRA_STREAM,mmsUri); 
intentMMS.setType("image/png");
intentMMS.setType("vnd.android-dir/mms-sms");
intentMMS.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//intent.se
startActivity(intentMMS);
FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
ρяσѕρєя K
  • 132,198
  • 53
  • 198
  • 213
  • It gives an error in the 'startActivity' part. Do you know the reason for that??? – 9T9 Mar 14 '12 at 03:58
  • @MoraRockey :hi,see this maybe helpful [MMS send](http://valent.googlecode.com/svn-history/r2/trunk/src/com/iriska/valentine/CreateMessage.java) – ρяσѕρєя K Mar 14 '12 at 04:53
  • Change it to startActivity(intentMMS); I've edited @imrankhan's answer already to correct that. – FoamyGuy Mar 14 '12 at 13:10