×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    5

    How to fake a normal SMS to inbox?

    I just want to create my incoming sms in the inbox by hand( fake a incoming sms in box as like N-SMS). I use the code below to create a sms in the inbox . but there is two problem about the solution.

    after I create a sms in the inbox , I open the sms app and switch the inbox folder, I see the sms which I create by code

    1
    Press the option and select the message detail :
    Data : 01-01-0000

    but I havs set the current system time, why can't get it?

    2 Select the sms which I create by code, I can't find the REPLY menu item. the sms can't be replyed. it looks like the system think the sms is to sent , not be received.

    Source Code:

    // Set SMS parameters
    TBuf <KMessageAddressLength > aAddress;
    TBuf <KMessageAddressLength > aName;
    TBuf <KMessageBodySize > aMessage;

    aAddress.Append(_L("123456"));
    aName.Append(_L("testname"));
    aMessage.Append(_L("body"));


    // Switch to the given folder
    iSmsMtm- >SwitchCurrentEntryL( KMsvGlobalInBoxIndexEntryId );

    iSmsMtm- >CreateMessageL( KUidMsgTypeSMS.iUid );

    TMsvEntry entry = iSmsMtm- >Entry().Entry();
    entry.SetInPreparation( EFalse );
    entry.SetVisible( ETrue );
    entry.iDate.HomeTime();
    entry.iDescription.Set( aAddress );
    entry.iDetails.Set( aAddress );
    entry.SetUnread( EFalse );

    iSmsMtm- >Entry().ChangeL(entry);
    iSmsMtm- >SaveMessageL();

    CMsvStore* aMessageStore = iSmsMtm- >Entry().EditStoreL();

    CleanupStack::PushL( aMessageStore );
    CRichText& body = iSmsMtm- >Body();
    body.Reset();
    body.InsertL( 0, aMessage );

    if(aFolderID == KMsvGlobalInBoxIndexEntryId)
    {
    CSmsHeader* header = CSmsHeader::NewL( CSmsPDU::ESmsDeliver, body );
    header- >SetFromAddressL( aAddress );
    //header- >SetToFromAddressL( aAddress );
    CleanupStack::PushL( header );
    header- >StoreL( *aMessageStore );

    aMessageStore- >StoreBodyTextL( body );
    aMessageStore- >CommitL();
    CleanupStack::PopAndDestroy( header );
    }

    CleanupStack::PopAndDestroy( aMessageStore );


    BTW:

    some guys on board get the same problem , but don't give any solution to solve it? help me!! Tks
    Last edited by luandao2000; 2007-09-20 at 15:04.

  2. #2
    Registered User
    Join Date
    Feb 2006
    Location
    Brazil
    Posts
    523

    Re: How to fake a normal SMS to inbox?

    i don't have a clue of how to do what you want, but you could take a look at this document:

    http://www.arib.or.jp/IMT-2000/V440M.../23040-650.pdf

    though i don't know if it'll help you.


    best regards
    Http_user_agent:
    NokiaN80-1/3.0 (4.0707.0.7)
    Series60/3.0
    Profile/MIDP-2.0
    Configuration/CLDC-1.1

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,748

    Re: How to fake a normal SMS to inbox?

    I have this
    Code:
    CSmsPDU *pdu=&header->Message().SmsPDU();
    CSmsDeliver *dpdu=STATIC_CAST(CSmsDeliver*,pdu);
    dpdu->SetServiceCenterTimeStamp(now,0);
    in my code, it might issue the date-issue (happened 2 years ago, cannot really remember).

  4. #4
    Registered User
    Join Date
    Jan 2007
    Posts
    5

    Smile Re: How to fake a normal SMS to inbox?

    Thanks very much for wizard_hu 's code!!!

    I have solve those two problem


    1 DateTime problem

    Use wizard_hu 's code . T

    2 Don't have the reply menu item.

    set name and address to a corrent phone number.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Re: How to fake a normal SMS to inbox?

    hi, I've try your code fake SMS to inbox.
    I can see "Reply" option when I open the SMS from inbox
    but there is still no "Reply" option in the SMS inbox List. did you get it by "set name and address to a corrent phone number"?
    if yes , Can you give an example ?
    Thanks!
    Last edited by awish; 2007-10-29 at 06:43.

  6. #6
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Bangalore
    Posts
    148

    Re: How to fake a normal SMS to inbox?

    Hi,

    Generally the reply option is not available if the from number field is empty. Check if there is a number set in that field.
    Regards,
    Pavan M.V
    ________________________________

    Email: pavan.mysore@symbian.com /pavan.vishu@gmail.com

  7. #7
    Registered User
    Join Date
    Jul 2007
    Posts
    3

    Re: How to fake a normal SMS to inbox?

    Quote Originally Posted by pavanmv View Post
    Hi,

    Generally the reply option is not available if the from number field is empty. Check if there is a number set in that field.
    I have set the from field using
    header- >SetFromAddressL( aAddress );
    the "aAddress" is a TBuf initialized with a number string "12345678".
    Is that anything I missed?

  8. #8
    Registered User
    Join Date
    Feb 2010
    Location
    India
    Posts
    281

    Re: How to fake a normal SMS to inbox?

    If anyone solved this issue ?

    experts please help

Similar Threads

  1. how to hide the sms in the sms inbox?
    By billqu in forum Symbian
    Replies: 2
    Last Post: 2006-06-26, 07:29
  2. SMS: how to write a new received sms into inbox
    By l24012 in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2004-12-21, 01:58
  3. SMS Inbox View
    By amitapm in forum Symbian
    Replies: 3
    Last Post: 2004-11-04, 07:30
  4. New message in SMS Inbox
    By isseyp in forum Mobile Java General
    Replies: 4
    Last Post: 2004-05-07, 14:45

Posting Permissions

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