iTurki
iTurki

Reputation: 16398

Android MMS Example

I tried to follow this answer about sending MMS through code.

However, I stopped when he start talking about BroadCastRecivers and Android git and not providing the code. I really get lost with this. It was very straight at the beginning but it becomes so complicated after that.

Can any one explain the missing code in that answer or provide it if it is exist ?

Thanks a lot

Upvotes: 1

Views: 3531

Answers (3)

MikeSaloonlight
MikeSaloonlight

Reputation: 11

In order to send MMS on Android, you can alternatively use a commercial MMS SDK instead of using the internal stack.

There's one from Winwap here that let's you send and receive MMS messages with simple functions, like the send-example from their docs:

1. Initialize the API by calling the mmss_init function
2. Connect to the HTTP Proxy or WAP Gateway using the mmss_connect function
3. Create MMS message of type SEND_REQUEST_TYPE by calling mms_message_create function
4. Add MMS headers using mms_set_header_str, mms_set_header_encstr or mms_set_header_long functions. Mandatory headers TRANSACTION_ID, FROM and CONTENT_TYPE shall be set. Also at least one of the headers TO, CC or BCC shall be set. Other headers suitable for this type of message are optional
5. Add content to MMS Message by the help of mms_add_content function
6. Call the mmss_send_message function
7. Destroy MMS message using mms_message_destroy function
8. Disconnect from the HTTP Proxy or WAP Gateway using the mmss_disconnect function
9. Finalize the API by calling the mmss_fini function

The downside is, it's a commercial product not available for free.

Upvotes: 1

iTurki
iTurki

Reputation: 16398

To those who might be interested:

MMS Functionality is a bit unreliable, not well-documented feature in Android. So, the existed solutions will not work always. You can't depend on them, yet.

Upvotes: 2

A. Abiri
A. Abiri

Reputation: 10810

I do not have experience in this type of problem but maybe this will help you out a bit:

Intent sendIntent = new Intent(Intent.ACTION_SEND);    
sendIntent.putExtra("sms_body", "some text");    
String url = "\\sdcard\\potrait.PNG";   
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));   
sendIntent.setType("image/png");    
startActivity(sendIntent);

This is a copy from here.

This is another example.

Upvotes: 0

Related Questions