×

Discussion Board

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

Thread: MMSExamle

  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    128

    MMSExamle

    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
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: MMSExamle

    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
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    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
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: MMSExamle

    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
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    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
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    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
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    Any help !

  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: MMSExamle

    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
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    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
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: MMSExamle

    but can you show us how you pass the captured image to mms sending code.

  11. #11
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    ////////////////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
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    It is right????

  13. #13
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: MMSExamle

    compare it with the wiki code http://wiki.forum.nokia.com/index.ph...an_MMS_message yourself.

  14. #14
    Regular Contributor
    Join Date
    Feb 2009
    Posts
    128

    Re: MMSExamle

    This exapmle is for 3rd edt but i have the second edt. there is a difference in attachement function

  15. #15
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: MMSExamle

    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.

Posting Permissions

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