Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 28

Thread: MMSExamle

  1. #1
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    Hi
    I am using MMSExaple in this forum. It work fine.
    But the MMS is constracted when i just start the application.
    I want to capture image then send it. The MMS exapmle use MMsvSessionObserver

    What can I do???

  2. #2
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    search for camera and capture keywords in wiki you will get more then one examples. then use those images in sending MMS.

  3. #3
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    Thnak skumar_rao
    Yes i can capture and save image.
    My question is when i use the MMsvSessionObserver same as in MMSExample, the MMS is constructed with an old captured image.
    The MMs is constructed when i start application.

    How can i captured the image after create the attachement????

  4. #4
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Quote Originally Posted by abdelbakiguesmi View Post
    Thnak skumar_rao
    Yes i can capture and save image.
    My question is when i use the MMsvSessionObserver same as in MMSExample, the MMS is constructed with an old captured image.
    The MMs is constructed when i start application.

    How can i captured the image after create the attachement????
    make sure you change the images path so that it will point to your captured image. also make sure your project generates a NEW sis file at end of build process.

  5. #5
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    Yes i change my image path and a NEW sis is generated file at end of build process.
    I implement the MMsvSessionObserver in Container class.
    My code :
    ///////////////container class////////////////

    TBool CRemoteSuveillanceContainer::CreateNewMessag(TFileName attachmentFile)
    {


    TBuf<20> addr(_L("97836138"));

    iRecipient->Des() = addr;

    CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId ,TMsvSelectionOrdering());
    CleanupStack::PushL(entry);

    // Set context to the parent folder (Outbox)
    iMmsMtm->SwitchCurrentEntryL(entry->EntryId() );

    // Create new message in the parent folder (Outbox) and set it as the current context.

    iMmsMtm->CreateMessageL( iMmsMtm->DefaultSettingsL() );

    CleanupStack::PopAndDestroy(); // entry

    // Setting recipients
    // use this to add the "To" recipients.
    iMmsMtm->AddAddresseeL( iRecipient->Des() );

    //Setting message subject
    _LIT(KMessageSubject, "MMS Example from abdou enjoy");
    iMmsMtm->SetSubjectL(KMessageSubject);

    // Message consists of one image
    // _LIT(Kimage, "E:\\Images\\abdou.jpg");
    // TFileName attachmentFile(Kimage);


    TMsvEntry ent = iMmsMtm->Entry().Entry();
    // Set InPreparation to false
    ent.SetInPreparation(EFalse);
    ent.SetVisible(ETrue); // mark as visible, after this the message can be seen in Outbox and, after sending, in Sent folder.
    iMmsMtm->Entry().ChangeL(ent); // Commit changes



    TMsvId attachmentID = KMsvNullIndexEntryId;
    iMmsMtm->CreateAttachment2L( attachmentID, attachmentFile );

    iMmsMtm->SaveMessageL();

    return ETrue;
    }


    TBool CRemoteSuveillanceContainer::SendMessageL()
    {


    CMsvOperationWait* wait = CMsvOperationWait::NewLC();
    wait->iStatus = KRequestPending;
    CMsvOperation* op = NULL;
    op = iMmsMtm->SendL(wait->iStatus );
    wait->Start();
    CleanupStack::PushL( op );
    CActiveScheduler::Start();


    CleanupStack::PopAndDestroy(2); // op, wait

    return ETrue;
    }


    //////////UI class//////////////////////
    //capture image
    CCameraController* iCameraController= CCameraController::NewL();
    iCameraController->InitializeCameraL();


    _LIT(Kimage, "E:\\Images\\abdou.jpg");
    TFileName attachmentFil(Kimage);

    Create and send captured image
    iAppContainer->CreateNewMessag(attachmentFil);
    iAppContainer->SendMessageL();

    Thank

  6. #6
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    Hi skumar_rao
    What do you say about my code???
    I am sure that MMS constrauct is done juste when i start my application !!
    Please help me

  7. #7
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    Any help !

  8. #8
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Quote Originally Posted by abdelbakiguesmi View Post
    Hi skumar_rao
    What do you say about my code???
    I am sure that MMS constrauct is done juste when i start my application !!
    Please help me
    looks fine to me, what error you are facing.

  9. #9
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    ok
    There is no error code.
    I want to capture image in the "E:\\Images\\abdou.jpg" path. then send it by MMS using this path. the two fuctions capture and send work fine separately.
    but when i do in the UI class :

    capture();
    SendMMS();

    The MMS is sended with the an old captured image!
    I think that MMS is constracted before the capture of image.

    Can i implement SendMMS fuction without MMsvSessionObserver ???
    Please see my code!

    Thank you a lot

  10. #10
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    but can you show us how you pass the captured image to mms sending code.

  11. #11
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    ////////////////caprure image/////////////
    the image is created in this path "E:\\Images\\abdou.jpg"
    ///////////////create MMS////////////////////////////////////
    TBool CRemoteSuveillanceContainer::CreateNewMessageL()
    {

    ///////////create image//////snap image/////

    CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId ,TMsvSelectionOrdering());
    CleanupStack::PushL(entry);

    // Set context to the parent folder (Outbox)
    iMmsMtm->SwitchCurrentEntryL( entry->EntryId() );

    // Create new message in the parent folder (Outbox) and set it as the current context.

    iMmsMtm->CreateMessageL( iMmsMtm->DefaultSettingsL() );

    CleanupStack::PopAndDestroy(); // entry

    // Setting recipients
    // use this to add the "To" recipients.
    iMmsMtm->AddAddresseeL( iRecipient->Des() );

    //Setting message subject
    _LIT(KMessageSubject, "MMS Example from abdou enjoy");
    iMmsMtm->SetSubjectL(KMessageSubject);

    // Message consists of one image
    _LIT(Kimage, "E:\\Images\\abdou.jpg");
    TFileName attachmentFile(Kimage);


    TMsvEntry ent = iMmsMtm->Entry().Entry();
    // Set InPreparation to false
    ent.SetInPreparation(EFalse);
    ent.SetVisible(ETrue); // mark as visible, after this the message can be seen in Outbox and, after sending, in Sent folder.
    iMmsMtm->Entry().ChangeL(ent); // Commit changes



    TMsvId attachmentID = KMsvNullIndexEntryId;
    iMmsMtm->CreateAttachment2L( attachmentID, attachmentFile );

    iMmsMtm->SaveMessageL();

    return ETrue;
    }

  12. #12
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    It is right????

  13. #13
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    compare it with the wiki code http://wiki.forum.nokia.com/index.ph...an_MMS_message yourself.

  14. #14
    Regular Contributor abdelbakiguesmi's Avatar
    Join Date
    Feb 2009
    Posts
    128
    This exapmle is for 3rd edt but i have the second edt. there is a difference in attachement function

  15. #15
    Nokia Developer Moderator skumar_rao's Avatar
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968
    Quote Originally Posted by abdelbakiguesmi View Post
    This exapmle is for 3rd edt but i have the second edt. there is a difference in attachement function
    you have not mentioned anywhere.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved