×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    How to parse a received MMS with SDK1.3 ?

    Hello,

    I need to do a simple thing using SDK1.3 : to save an MMS picture to a file.

    The source code I'm using is something like:

    [...]
    MultipartMimeContent mmc = receivedMMS.getMultipart();
    for (int i=0; i<mmc.getSize(); i++) {
    MimePart mp = mmc.getBodyPart(i);

    // What to add here to save for instance a jpg picture to
    // a file ?
    }

    Thanks in advance for any help or support !

    Pascal

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    Solved

    Hi

    I just found a solution to my question. Thank you all for all the answers I received :-)))

    I post the source code just in case it may help somebody else:

    [...]
    MultipartMimeContent mmc = recievedMsg.getMultipart();

    // Read all the mime parts
    for ( int i=0; i<mmc.getSize(); i++ ) {
    System.out.println( "Mime part " + i + ":" );
    MimePart mp = mmc.getBodyPart( i );
    String content_type = mp.getContentType();
    if ( content_type.startsWith( "image/jpeg" ) ) {
    System.out.println( "- content-type: " + mp.getContentType() );
    System.out.println( "- content location: " + mp.getContentLocation() );
    System.out.println( "- content size: " + mp.getSize() );

    // Write to disk the image received
    default_handler = new MMSDefaultHandlerImpl();
    byte raw_content[] = (byte[])default_handler.getRawContent( mp.getContent(), mp.getContentType() );
    FileOutputStream fos = new FileOutputStream( "/tmp/" + mp.getContentLocation() );
    fos.write( raw_content );
    }
    if ( mp.getContentType().startsWith( "text/plain" ) ) {
    System.out.println( "- content-type: " + mp.getContentType() );
    System.out.println( "- value: " + mp.getContent() );
    }
    }
    [...]

    - pascal

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    7

    can you help me

    I have a trouble using Nokia Mobile Server Service SDK 1.3. I installed it on Windows Xp Professional Edition and
    My Internet Explorer version is IE Version 6.0. I did not get any problem during its installation. When I try to
    start the application by running Start | Programs | Nokia | Server SDKs | Emulator 1.2 | Emulator Server on start menu
    and then start the emulator interface by running Start | Programs | Nokia | Server SDKs | Emulator 1.2 | Emulator
    GUI on start menu, The application windows did not appear. So that I can not configure and use the application.


    The application seems did not work as well as in the interface emulator installation guide. Can you tell me what's wrong
    with it ? Do you have any solution to solve this problem ???

    Thank You..

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    MMS SDK 1.3 req

    Hi,

    I had the same problem, I don't remember clearly but I believe it doesn't work on XP :-)

    I remember clearly I had to install Windows 2000 to run SDK !

    Read again the installation document follow the requirements ...

    Cheers
    - pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •