Question

How to programmatically send an MMS in blackberry?

Was it helpful?

Solution

MMS API (4.6 and >)

There is a net.rim.blackberry.api.mms class which "Provides advanced utilities for interaction with the MMS messaging system.". But this gives only ability to "modify the message before it is sent or deny it from being sent completely" using addSendListener

Using MMS protocol in connection

from javax.microedition.io.Connector API:

mms
This protocol opens an MMS connection across the wireless network. The open request should be formatted as follows:

(MessageConnection) Connector.open("mms://[<peer_address >]:[<application_Id>]");

where:

  • < peer_address > is the phone number or the email address of recipient.
  • < application_Id > is used to identify a Java application.

For example, to send a mms message to specific application use

Connector.open("mms://+123456789:applicationID");

To open a server mode MessageConnection use

Connector.open("mms://:applicationID");

Also see Introduction of MMS in J2ME and sample code - How to send MMS? and Sending and Receiving MMS on J2ME devices

I have never tried this approach, so I can't tell if it's working.

Invoking Messages application

Other option is open Messages application programmatically, to compose MMS:

Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES,
 new MessageArguments(MessageArguments.ARG_NEW_MMS));

Also see Invoking MMS with attachment using application.

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