0

I am working on message capture application for blackberry.

I use this to capture 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'
}

My question is, how can I retrieve the actual image from the BinaryMessage object?

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Sali
  • 101
  • 1
  • 10

1 Answers1

0

I haven't worked with BinaryMessage before, but looking at the docs, it appears BinaryMessage.getBytes() would be the next step for your program. You will have to figure out what the encoding is to turn those bytes into something more meaningful. If you know through some other means what the encoding is, then you can hand those bytes to a decoder. Otherwise, you will have to save them somewhere and do some more analysis of the bytes as part of your development process to figure out the encoding.

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44