i have an application that reads incoming sms messages via MMsvSessionObserver derived class. another MMsvSessionObserver derived class which is also an Active object (derived from CActive) is responsible for sending replies back. the flow is like this:
1) reader class receives incoming sms, copies the message onto a queue, and calls SetActive() on the sender class.
2) the sender class dequeues the msg and sends a reply back to the sender.
the problem: this works successfully ONCE. when the second sms arrives, the machinery above does not kick in. also, if i inject a CEikonEnv::InfoWinL() call when i receive a msg, it works ALL THE TIME. i'm not sure why this call to InfoWinL() is helping to make things work...
I need to find out the count of sent/received SMS. For this i think i need to write an active object which should track the SMS event whenever there is an SMS incoming/outgoing.
My question is how to write this active object? how to track this event? Say if i put a thread in my application which will keep track of this event, does it work? In your post you said that u are able to track incoming/outgoing of SMS. could you please send me that code?
And one more question is, i want to find out the size of data coming in and going out of the mobile? how do we find out this?
I am using Series 60 SDK and for Nokia 7650 model.
I have gone through the SMS sending example. I found a method HandleSessionEventL() and rest of the code is depended on the arguments of that method.
But in my case i dont want any active object, sending or receiving SMS. All i need is at the end of the day my application should find out the SMS's sent/received from the device and for each SMS i have to read the header information. For this i hope i no need to use the HandleSessionEventL().
I am using the following code: Please take a look at it.
sort.SetShowInvisibleEntries(ETrue); // we want to handle also the invisible entries
// Take a handle to the Inbox entry
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, sort);
CMsvEntrySelection* entries = parentEntry->ChildrenL(); // A selection of all the entries of the Inbox
// go through all entries in the Inbox
for(TInt i = 0; i < entries->Count(); i++)
if( parentEntry->ChildDataL(entries->At(i)).iMtmData3 == KUidMsgTypeSMS ) // check that message is for GDSMS
CleanupStack::PopAndDestroy(2); // entries, parentEntry
But when i compiled i am getting an error 'KUidMsgTypeSMS undeclared identifier'. I couldn't find any header file or information related to this constant. which header file/library i have to include for this?
Is the code snippet is correct? Am i going in the correct way? Please make necessarry changes if necessarry changes.
Please help me? Your input will be very helpful for me and i am running out of time.
// MUST implement virtual from MMsvSessionObserver
void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3)
// we're interested in incoming and outgoing msgs
if(*(static_cast<TMsvId*>(aArg2)) == KMsvGlobalInBoxIndexEntryId)
incoming = true;
if(*(static_cast<TMsvId*>(aArg2)) == KMsvSentEntryId)
incoming = false;
return; // dont care about other folders
So many thanks for your immediate response. I was able to find out the count of SMS's received/sent without using any active object.
Thats ok, but i was not able to read the received/sent date and time of each SMS. i did not find any suitable method to read them. i was able to view them on the device under Message Details option of SMS. how can we access this?
Do you have any idea on how to read the SMS date and time?
And any idea about how to find out the size of the data sent and received?
The same SMS example shows you how to read this information. Please use the example in conjunction with the SDK Help documentation, especially page concerning class TMsvEntry. This will give you answers to your questions.
HBufC* msg = HBufC::NewL(len); CleanupStack::PushL(msg);
TPtr pMsg = msg->Des();
//copy sms message body
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
//I can display the SMS data for incoming sms, but can not display //the out sms data
} // end for
} // end case
} // end switch
Where am i doing mistake? why i was not able to trap the outgoing sms event?