i am a new to symbian C++. i would like to know if it is possible to do a sms counter application for s60 3rd ed.
i am a new to symbian C++. i would like to know if it is possible to do a sms counter application for s60 3rd ed.
Welcome to the DiBo :-)
Yes it is possible, a nice starting point would be the wiki,
http://wiki.forum.nokia.com/index.php/SMS_Operations
Cheers,
Mayank
If you want to count the SMS-s in your Inbox, the following snippet may already do thatand count will contain the number of SMS-s in the Inbox.Code:CMsvSession *session=CMsvSession::OpenSyncL(*this); CleanupStack::PushL(session); CMsvEntrySelection *selection=new(ELeave)CMsvEntrySelection; CleanupStack::PushL(selection); CMsvEntryFilter *filter=CMsvEntryFilter::NewLC(); filter->SetMtm(KUidMsgTypeSMS); session->GetChildIdsL(KMsvGlobalInBoxIndexEntryId,*filter,*selection); TInt count=selection->Count(); CleanupStack::PopAndDestroy(3); // filter, selection, session
oh sorry. i want to noe how to calculate the amount of sms have been sent out.
Note that there is a setting in the Messaging application which limits the number of messages saved in the Sent folder.
ok. thx guys. but wat if i deleted some sent msg , will it affect e counter?
Yes it will, coz the counter will read only what is there in those folders,maybe you can write a watcher which notifies you when a message has been deleted/is being deleted from the sent folder, though I havent written code for this one so I am not sure how that would work, but something worth trying.
Cheers,
Mayank
ok. but i do not know how to do a watcher. do u have example?
Track/log events in HandleSessionEventL, and you will see what events you get when sending an SMS.
hi, i have place some codes in HandleSessionEventL but is not working. need help. thx.
is this right?Code:case EMsvEntriesMoved: { // Entry id is obtained from the session event arguments. TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 ); // We are interested in messages that are moved to Sent Item Folder if (*entryId == KMsvSentEntryId) { CAknGlobalNote* dialog = CAknGlobalNote::NewLC(); TBuf<250> msg; msg.Append(_L("Sent")); dialog->ShowNoteL(EAknGlobalInformationNote, msg); } break; }
When I suggested "Track/log events", I meant getting a debugger or creating a logfile and checking what was happening. Instead of that you decided to try a single possible combination out of many. You say it does not work, and I have no reason to doubt your words.