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???
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???
search for camera and capture keywords in wiki you will get more then one examples. then use those images in sending MMS.
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????
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
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
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
but can you show us how you pass the captured image to mms sending code.
////////////////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;
}
compare it with the wiki code http://wiki.forum.nokia.com/index.ph...an_MMS_message yourself.
This exapmle is for 3rd edt but i have the second edt. there is a difference in attachement function