×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    7

    Read incoming SMS problems

    dear all,
    i have read most threads that talking about SMS and also wiki examples
    but i still don't able to solve my problem

    i tried the smshandler example and sms receiver example and also the sms operation
    but all give me the same problem
    i'm using sdk 2nd edition FP2
    and want to make my application read the sms when it arrives and gets the content of it and the sender number ok

    Code:
        CMsvStore* msgStore = iSmsMtm->Entry().ReadStoreL();
        CleanupStack::PushL(msgStore);
        if(msgStore->HasBodyTextL())
        	{
        	CRichText& richText= iSmsMtm->Body();
        	msgStore->RestoreBodyTextL(richText);
        	const TInt length = richText.DocumentLength();
        	HBufC* message = HBufC::NewLC(length);
        	TPtr messagePtr = message->Des();
        	messagePtr.Copy(richText.Read(0,length)); 
        	CAknInformationNote* Note = new (ELeave) CAknInformationNote;
        	TBuf<256> t;
        	t.Copy(messagePtr);
    		Note->ExecuteLD(t);
        
        	// now message contains the Message Body
        	CleanupStack::PopAndDestroy(message);
        	}
    here is the problem
    the
    Code:
    msgStore->HasBodyTextL()
    always return false at the emulator and i don't know why
    any ideas please
    thnx in advance

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Read incoming SMS problems

    EMsvEntriesCreated or EMsvEntriesChanged?

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    7

    Re: Read incoming SMS problems

    hi wizard_hu_
    EMsvEntriesCreated
    thnx for your help and time

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    7

    Re: Read incoming SMS problems

    hi all,
    i tried to use EMsvEntriesChanged by using SMS Engine
    it entries the EMsvEntriesChanged 3 times the first two of them the it was the same as EMsvEntriesCreated and in the 3rd time it works
    ok does this what happen at the device or that is only happen at the emulator?

    another thing could i manage to get that result using the smshandler that exist in the wiki section
    Last edited by mohamedmagdy; 2009-05-07 at 15:27.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Read incoming SMS problems

    It is normal, expect something similar on the devices too (maybe 2 instead of 3).
    If you check SMS examples, they
    - store the id of the new message on EMsvEntriesCreated - this way they can make sure that changes of the new message are going to be tracked
    - check the id when EMsvEntriesChanged happens. Then they try to get the body. It is going to succeed on the last attempt
    So the exact number of EMsvEntriesChanged does not matter, but it is usually more than 1.

Similar Threads

  1. Struggling to sound an alert on incoming SMS
    By colin@icrsystems.co.uk in forum Symbian
    Replies: 3
    Last Post: 2007-07-08, 18:01
  2. Send SMS Problem. Cannot Get SMSC Address. Due to Strange SIM Card?
    By cksong in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-07-02, 16:13
  3. Custom incoming sms melody
    By dek_t in forum Symbian
    Replies: 0
    Last Post: 2007-06-05, 10:18
  4. MIDlet block the incoming SMS
    By cars2003 in forum Mobile Java General
    Replies: 2
    Last Post: 2004-02-05, 13:29

Posting Permissions

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