×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Not listen incoming sms

    Hi All,

    i made an application for listen incoming sms, but when i launch this exe this does not wait and not listen sms. Also read sms listener example from wikki.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  2. #2
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: Not listen incoming sms

    Hi,
    How are you testing this application? I guess the wiki example for SMS is working fine. Have you tried putting logs in your application and check where is the problem occuring?
    Maximus
    S60 Developer
    Impossible is nothing

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Not listen incoming sms

    Hi amit,

    The article is working perfectly as it is expected to, perhaps there a leave in your code trying logging it would help you in tracking the problem need not tell you.
    Regards,
    Sriky

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Not listen incoming sms

    Quote Originally Posted by aamitgupta View Post
    Hi All,

    i made an application for listen incoming sms, but when i launch this exe this does not wait and not listen sms. Also read sms listener example from wikki.
    what capabilities you have ... what is the panic you are getting .

  5. #5
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Not listen incoming sms

    Quote Originally Posted by skumar_rao View Post
    what capabilities you have ... what is the panic you are getting .
    Nothing panic , exe not wait for incoming sms my code is following, after constructl exe not wait,

    Code:
    void CSms::ConstructL()
    	{
    		if (CActiveScheduler::Current())
    		CActiveScheduler::Add(this);
    		iSmsOutSession = CMsvSession::OpenAsyncL(*this);
    		iSelection = new ( ELeave ) CMsvEntrySelection();
    		
    	}
    
    void CSms::HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3)
    	{
    		 switch(aEvent)
    	 	{
    	 		case EMsvEntriesCreated:   
    	 			{
    	 				 			TBuf8<20> data(_L8("EMsvEntriesCreated"));
    	 				 			 			print_des8(data);
    	 				break;
    	 			}
    	 		case EMsvEntriesChanged:
    	 			{
    	 			TBuf8<20> data(_L8("EMsvEntriesChanged"));
    	 				 			 			print_des8(data);
    	 			//print_des(_L("EMsvEntriesChanged"));
    	 				break;
    	 			}
    	 		case EMsvEntriesDeleted:
    	 			{
    	 			TBuf8<20> data(_L8("EMsvEntriesDeleted"));
    	 				 			 			print_des8(data);
    	 			
    	 				break;
    	 			}
    			case EMsvEntriesMoved:  
    	 		{
    	 		TBuf8<20> data(_L8("EMsvEntriesMoved"));
    	 			 			print_des8(data);
    	 						break;
    	 		}
    	 	
    	 		case EMsvServerReady:
    	 			{
    	 			//print_int(7);
    	 			TBuf8<20> data(_L8("EMsvServerReady"));
    	 			print_des8(data);
    	 			TMsvId serviceId( KUidMsgTypeSMS.iUid ); // SMS service id
    
    	            // Determine if the event was succesful.
    	            // ServiceProgress inserts TBuf8 value in progress.
    	            TBuf8<100> progress;
    	            iSmsOutSession->ServiceProgress( serviceId, progress );
    				_LIT8( KCompare, "KErrNone" );
    
    				if ( progress.Compare( KCompare ) )
    					{
    	                // Check that MtmRegistry has not already been accessed.
    	                if ( !iMtmReg )
    	                    {
    	                    CompleteConstructL();
    	                    }
    	                }
    	 			break;
    	 			}
    			
    	 		
    	 		default:
    	 		break;
    	 	}
    		
    	}
    
    void CSms::CompleteConstructL()
    	{
    		print_int(2);
    //		iMtmReg = CClientMtmRegistry::NewL(*iSmsOutSession);
    //		iMtm=iMtmReg->NewMtmL(KUidMsgTypeSMS);
    //		CSmsClientMtm* smsMtm = STATIC_CAST(CSmsClientMtm*, iMtm);
    //		smsMtm->RestoreServiceAndSettingsL();
    		 // Create an MTM Registry object.
    	       iMtmReg = CClientMtmRegistry::NewL( *iSmsOutSession );
    	
    	           // Create an SMS Client MTM object.
    	      ismsMtm = STATIC_CAST( CSmsClientMtm*, iMtmReg->NewMtmL( KUidMsgTypeSMS ) );
    
    		print_int(3);
    	}
    Capabilities are: TrustedUI NetworkServices LocalServices UserEnvironment ReadUserData WriteUserData Location PowerMgmt ProtServ SurroundingsDD SwEvent ReadDeviceData WriteDeviceData
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  6. #6
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: Not listen incoming sms

    Hi,
    Have you tried logging in your application? How u are concluding that the code is leaving? I would say you can put the log and then recheck it again.May be some logical flaw because of which your code is not getting invoked on incoming SMS.
    Maximus
    S60 Developer
    Impossible is nothing

  7. #7
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Not listen incoming sms

    session opening code looks good to me still you try getting error http://wiki.forum.nokia.com/index.ph...or_messages%3F

  8. #8
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Not listen incoming sms

    Quote Originally Posted by skumar_rao View Post
    session opening code looks good to me still you try getting error http://wiki.forum.nokia.com/index.ph...or_messages%3F
    I am not able to use SmsReceiver.cpp file in my code that is from wikki, how can i make object of this class, because i do not understand about MSMSRecCallBack& aObserver, so please help me.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  9. #9
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Not listen incoming sms

    Code:
    class MSMSRecCallBack 
    {
    public:
    	virtual void GotSMSMessageL(const TDesC& aMessage) = 0;
    };
    if you are using in appUi then

    Code:
    class CWRUAppUi : public CAknAppUi, MSMSRecCallBack
    then while creating a object use iSMSReceiver = CSMSReceiver::newLC(*this);

  10. #10
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Not listen incoming sms

    Quote Originally Posted by skumar_rao View Post
    Code:
    class MSMSRecCallBack 
    {
    public:
    	virtual void GotSMSMessageL(const TDesC& aMessage) = 0;
    };
    if you are using in appUi then

    Code:
    class CWRUAppUi : public CAknAppUi, MSMSRecCallBack
    then while creating a object use iSMSReceiver = CSMSReceiver::newLC(*this);
    No i am not using appui, it is console based application, so in our main cpp file do same.
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  11. #11
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Not listen incoming sms

    Quote Originally Posted by aamitgupta View Post
    No i am not using appui, it is console based application, so in our main cpp file do same.
    just given one example.

  12. #12
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Not listen incoming sms

    Quote Originally Posted by aamitgupta View Post
    No i am not using appui, it is console based application, so in our main cpp file do same.
    Thanks Kumar i fixed the issue, i was not starting CActiveScheduler so exe was not waiting. Thanks
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

  13. #13
    Registered User
    Join Date
    Jul 2007
    Location
    Noida
    Posts
    1,503

    Re: Not listen incoming sms

    Ok i want one thing more but not doing, when an entry is created on inbox, menas in handlesessioneventl a sms comes event goes to EMsvEntriesCreated, on that time i want retrive recent incoming message number only, is that any idea?
    Regards,
    Amit


    ****"Putting a Smile on other's faces is the essence of true Happiness"****

Similar Threads

  1. 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
  2. Need urgent help with incoming sms number.
    By Donnieng in forum Symbian
    Replies: 1
    Last Post: 2007-06-16, 05:52
  3. Replies: 1
    Last Post: 2006-09-15, 08:48
  4. How to retrieve CSmsHeader of a incoming sms
    By madsum in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-04-03, 13:18
  5. Listen to SMS
    By boogieeee in forum General Messaging
    Replies: 1
    Last Post: 2004-06-03, 13:53

Posting Permissions

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