1

First of all, I know this question has been asked before here: -

How to send MMS in J2ME?

I think the links provided there are likely to contain the answer I need, I just think I don't understand the subject (MMS and J2ME) particularly well.

Basically, it seems to me that with the provided answer a J2ME MMS sender client sends a message to another phone running a J2ME receiver client. The receiver client then intercepts the incoming MMS and displays it, or whatever.

What I want to do is programmatically send a bog standard MMS (a picture message actually) to another phone, just as though I was using the standard 'new message' functionality provided by the phone - so no J2ME client running on the target phone, I just want it to appear as a normal new message.

To summarise, what I want to do in pseudo code is: -

MMSMessage msg = new MMSMessage();
msg.setDestinationNumber("0771234567");
msg.setImage("E:\\image.jpg");
msg.send();

Is this possible in J2ME? And if so does anyone know how I can achieve it, what parts of the solution to the previous question do I have to use?

Thanks,

Simon

Community
  • 1
  • 1
Simon
  • 115
  • 1
  • 9

1 Answers1

1

Basically, it seems to me that with the provided answer a J2ME MMS sender client sends a message to another phone running a J2ME receiver client. The receiver client then intercepts the incoming MMS and displays it, or whatever.

No, this is not necessarily the case.

When sending SMS or MMS from Java ME (using JSR 120/205), messages are addressed to a URL which looks like: sms://<number>:<port>, or mms://<number/emailaddress etc>:<endpoint>. However the port or endpoint parts are optional. They should be used if you want another MIDlet on the receiving handset to receive and process the message. If you want it to go to the regular inbox then you just omit the :<endpoint> part.

funkybro
  • 8,432
  • 6
  • 39
  • 52
  • Right, that sounds good. So if I want to send a MMS then I do "mms://+5550000" I omit the :, what about the :? Do I omit that too, or is there a specific port I should use for MMS? – Simon Jun 06 '11 at 10:18
  • Yeah may have been confusing. I used `port` for SMS because it can only be a number, `endpoint` for MMS can be any string within reason (look at the JSR205 spec for a full syntax if you're interested). Your message connector URL should just be `mms://+5550000`. Messages sent to an endpoint e.g. `mms://+5550000:blah` are known as "routed", and can be received by a server app on the receiving handset, running on the URL `mms://:blah`. If no such server app is running, then some handsets will direct a routed message into the native inbox, while others silently discard it. – funkybro Jun 06 '11 at 10:26
  • I've got this working fine for SMS now - it works perfectly. However, I'm having a problem with MMS. From the example given I need to use: - MultipartMessage mmmessage =(MultipartMessage) mmsconn.newMessage(MessageConnection.MULTIPART_MESSAGE). However, when running this on the phone I get java.lang.IllegalArgumentException: No valid message type. Any ideas? Thanks – Simon Jun 06 '11 at 14:42
  • What phone is it? Does it support JSR 205 MMS? To find out programmatically, check for the existence of the system property `wireless.messaging.mms.mmsc`. – funkybro Jun 06 '11 at 15:04
  • I'm currently using a 5630 XM. I have access to a number of Symbian S60 3rd Edition phones, and a handful of 5th (N97 Mini is one I can recall off the top of my head). I also have a couple of Symbian ^3 devices somewhere. Have you got any recommendations of phones to use? – Simon Jun 06 '11 at 15:11
  • The system property wireless.messaging.mms.mmsc shows http://mmsc.mms.o2.co.uk:8002 – Simon Jun 06 '11 at 15:19