×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    how to move sms from one folder to another?.....plz help

    hi 2 all

    i want to move sms from inbox to a folder in "My folder" option.....programatically.

    can anyone help me in this regard?

    any help will be highly appreciated.

    regards
    bharat

  2. #2
    Registered User
    Join Date
    Aug 2006
    Posts
    92

    Re: how to move sms from one folder to another?.....plz help

    hi,

    For moveing your sms to your folder you need SMSID and

    FolderId. For this purpose you can use mtm engine.

    Use this for moveing...

    // Move message to folder. Notice that the iSmsMtm points to the parent, not
    // to the message itself. If you move messages from inbox to drafts, those
    // messages cannot be edited because their complete flag is true.
    void CSMSExampleMtmsEngine::MoveToFolderL( TMsvId aMessageId, TMsvId aFolder )
    {
    iSmsMtm->SwitchCurrentEntryL( aMessageId );
    TMsvSelectionOrdering selection;
    selection.SetShowInvisibleEntries(ETrue);
    CMsvEntry* parentEntry = CMsvEntry::NewL( iSmsMtm->Session(),
    iSmsMtm->Entry().Entry().Parent(), selection );
    CleanupStack::PushL(parentEntry);
    // Move the message
    parentEntry->MoveL( aMessageId, aFolder );
    CleanupStack::PopAndDestroy(parentEntry); // parentEntry
    }


    Thanks And Regards
    Yogesh

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to move sms from one folder to another?.....plz help

    hi ....

    yah i have this code from smsexample`s mtmsengine file....but what do i mean by
    "Notice that the iSmsMtm points to the parent, not
    to the message itself."

    i mean how should i get the id of perticular sms in inbox?

    and as i have created a new folder in "My folder" option programatically...how should i get the id of that newly created folder?

    can anyone help me plz.?

    awaiting for your valuable reply.

    Regards
    bharat

  4. #4
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to move sms from one folder to another?.....plz help

    hi 2 all

    as i am having a function

    // Move message to folder. Notice that the iSmsMtm points to the parent, not
    // to the message itself. If you move messages from inbox to drafts, those
    // messages cannot be edited because their complete flag is true.
    void CSmsHandler::MoveToFolderL( TMsvId aMessageId, TMsvId aFolder )
    {
    iSmsMtm->SwitchCurrentEntryL( aMessageId );
    TMsvSelectionOrdering selection;
    selection.SetShowInvisibleEntries(ETrue);
    CMsvEntry* parentEntry = CMsvEntry::NewL( iSmsMtm->Session(),
    iSmsMtm->Entry().Entry().Parent(), selection );
    CleanupStack::PushL(parentEntry);
    // Move the message
    parentEntry->MoveL( aMessageId, aFolder );
    CleanupStack::PopAndDestroy(parentEntry); // parentEntry
    }

    then i called this function from HandleSessionEventL() functions EMsvEntriesCreated event as

    case EMsvEntriesCreated:
    {
    // Entry id is obtained from the session event arguments.
    TMsvId* entryId = STATIC_CAST( TMsvId*, aArg2 );

    // We are interested in messages that are created in Inbox.
    if ( *entryId != KMsvGlobalInBoxIndexEntryId )
    {
    break;
    }

    // We take the created entries into a selection
    CMsvEntrySelection* newEntries =
    STATIC_CAST( CMsvEntrySelection*, aArg1 );

    // Process each created entry.
    for ( TInt i( 0 ); i < newEntries->Count(); i++ )
    {
    // We are interested in SMS messages.
    if ( ( iSession->GetEntryL( newEntries->At( i ) ) )
    ->Entry().iMtm == KUidMsgTypeSMS )
    {
    MoveToFolderL( *entryId, KMsvMyFoldersEntryId);
    // Add the entry to the selection of all received messages.
    iSelection->AppendL( newEntries->At( i ), 1 );

    // Set received messages visible.
    MessageReceivedL( newEntries->At( i ) );
    }
    }

    break;
    }


    then i made a sis any deployed it on device.
    then i sent a sms from another device and checked that whether received sms is getting transferred or not?.
    but it is not transferred to "My folder" option.

    can anyone suggest regarding how should i move incoming sms from inbox to a perticular folder?

    awaiting your valuable reply.

    Regards
    bharat

  5. #5
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to move sms from one folder to another?.....plz help

    hi 2 all


    is there any other event for sms received.....so that i can try for that too.


    awaiting your valuable reply.

    regards
    bharat

Similar Threads

  1. Not Every phone receive SMS from WMA
    By youngboyguy in forum Mobile Java General
    Replies: 4
    Last Post: 2011-01-24, 04:56
  2. Can I delete SMS entry from SENT folder
    By pankajmahto in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2006-10-03, 04:34
  3. Replies: 0
    Last Post: 2006-07-24, 13:39
  4. Replies: 0
    Last Post: 2006-07-24, 08:21
  5. Replies: 2
    Last Post: 2002-10-02, 07:15

Posting Permissions

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