Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Regular Contributor
salmanali2074
Posts: 55
Registered: ‎04-04-2012
My Device: BB Device

How to retrieve the image from MMS

I am trying to get the image from the captured MMS messages, but I only get the content type, number and a address from the byte[]. 

 

How can I get the actual image?

 

Here is the byte[] in base64 that I received from BinaryMessage:

AQYnYXBwbGljYXRpb24vdm5kLndhcC5tbXMtbWVzc2FnZQCvhI0BgrSEjIKYRTUwNDA0MjAxNDMwNzAwMDE1MDAwMDIwMDAwAI2QiRiAKzE5MTc4ODE1NzIzL1RZUEU9UExNTgCWAuoAioCOAoAAiAWBAwVGAINodHRwOi8vMTk4LjIyOC4yMzguNTg6ODAwNy8wNDA0MjAxNDMwNzAwMDE1MDAwMDIwMDAwAA==

 

 

I use the following code to capture the messages. 


if(TextMessage.class.isAssignableFrom(msg.getClass()))

{
  TextMessage tmsg = (TextMessage)msg;
}
else if(MultipartMessage.class.isAssignableFrom(msg.getClass()))
{
  MultipartMessage mmsg = (MultipartMessage)msg;
  ProcessMultiPartMsg(mmsg);
}
else if(BinaryMessage.class.isAssignableFrom(msg.getClass()))
{
  BinaryMessage bmsg = (BinaryMessage)msg;
  // how to retrieve image from 'bmsg'
}

 

 

Please help.

 

Please use plain text.
Regular Contributor
salmanali2074
Posts: 55
Registered: ‎04-04-2012
My Device: BB Device

Re: How to retrieve the image from MMS

 

anybody have any idea how can I achieve this?

 

-SA

Please use plain text.
Developer
simon_hain
Posts: 16,215
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to retrieve the image from MMS

did you try a base64-decode followed by http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/EncodedImage.html#creat... int, int) ?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
salmanali2074
Posts: 55
Registered: ‎04-04-2012
My Device: BB Device

Re: How to retrieve the image from MMS

Thanks. At least someone there on this forum.

 

First of all, here is the decoded string: 

'application/vnd.wap.mms-message�¯„‚´„Œ‚˜E50404201430700015000020000�‰€+19178815723/TYPE=PLMN�–ê�Š€Ž€�ˆF�ƒhttp://198.228.238.58:8007/0404201430700015000020000

 

I see some information here but don't know where is the image data or how to get the image data? I called the url (http://198.228.238.58:8007/0404201430700015000020000) in browser but nothing happened. 

 

-SA

Please use plain text.
Developer
simon_hain
Posts: 16,215
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: How to retrieve the image from MMS

maybe you should read the MMS specifications. i am not familiar with them, but maybe the message does not contain the image, but only the URL to download it?
http://en.wikipedia.org/wiki/Multimedia_Messaging_Service seems to say that.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.