×

Discussion Board

Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    26

    How to display SMS in my application ?

    Hi,

    I new to Symbian. I need a little help.

    Could anyone kindly tell me what is the proper way to display an SMS from my application? How can I use the default message viewer to view my SMSs? I am creating my own Inbox and sent message folders. I am using S60 3rd edition SDK for Symbian C++. My target device in N95.

    Thanks in advance.

  2. #2
    Super Contributor
    Join Date
    Jan 2008
    Location
    Bangalore, India
    Posts
    777

    Re: How to display SMS in my application ?

    Quote Originally Posted by madhurjya.pb View Post
    Hi,

    I new to Symbian. I need a little help.

    Could anyone kindly tell me what is the proper way to display an SMS from my application? How can I use the default message viewer to view my SMSs? I am creating my own Inbox and sent message folders. I am using S60 3rd edition SDK for Symbian C++. My target device in N95.

    Thanks in advance.

    first read the sms by this u can see it
    http://wiki.forum.nokia.com/index.php/SMS_Operations

    after read just save it and show on ur app view.
    save it in db.
    Regards
    $-Nitesh-$

  3. #3
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    26

    Re: How to display SMS in my application ?

    Quote Originally Posted by Nitesh Bhardwaj View Post
    first read the sms by this u can see it
    http://wiki.forum.nokia.com/index.php/SMS_Operations

    after read just save it and show on ur app view.
    save it in db.


    Thanks Nitesh,

    I'll check it out ...

  4. #4
    Registered User
    Join Date
    Mar 2008
    Location
    India
    Posts
    26

    Re: How to display SMS in my application ?

    Quote Originally Posted by Nitesh Bhardwaj View Post
    first read the sms by this u can see it
    http://wiki.forum.nokia.com/index.php/SMS_Operations

    after read just save it and show on ur app view.
    save it in db.


    Hi Nitesh,

    Sorry, again. The example is a nice one. But not exactly what I was looking for. OK, I will get the message in a file. But, how should I display it on a view. You, told me to show it on app view. that means on CAknView class container ??..

    actually I wanted to show it as it looks in case of default message viewer. Could you kindly tell what API or class I need for that.

    With Thanks

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,347

    Re: How to display SMS in my application ?

    Quote Originally Posted by madhurjya.pb View Post
    Hi Nitesh,

    Sorry, again. The example is a nice one. But not exactly what I was looking for. OK, I will get the message in a file. But, how should I display it on a view. You, told me to show it on app view. that means on CAknView class container ??..

    actually I wanted to show it as it looks in case of default message viewer. Could you kindly tell what API or class I need for that.

    With Thanks
    You can try RichTextEditor. Search for "CEikRichTextEditor" on Wiki.

    Kiran.
    Nokia Developer Wiki Moderation team

  6. #6
    Registered User
    Join Date
    Aug 2010
    Posts
    43

    Re: How to display SMS in my application ?

    I am facing the same problem...
    I have to display the sms in a view. I have the sms's in an (user defined "TArrayElements") array.
    class TArrayElements: public CBase
    {
    public:
    TBuf<100> ismsText;
    TBuf<15> ismsNumber;
    TBuf<20> iTmsvId;
    };

    I am able to retrieve the sms but the application crashes while i try to display it in the View.
    Please help
    Last edited by PallaviMajgaokar; 2010-09-24 at 13:00. Reason: hadn't defined the problem properly

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: How to display SMS in my application ?

    Get the error message: http://wiki.forum.nokia.com/index.ph...ded_panic_code
    If you are experimenting with DrawText, make sure that you have set a font (CGraphicsContext::UseFont, a quick way for getting fonts is using CEikonEnv::Static()->TitleFont() or some other getter).

  8. #8
    Registered User
    Join Date
    Aug 2010
    Posts
    43

    Re: How to display SMS in my application ?

    It says,
    E32User CBase 21...
    I put logs in the application.
    But i am not able to find the exact point of failure.
    It crashes some time after DoActivateL.

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: How to display SMS in my application ?

    E32USER-CBase 21 has a very specific description, check it in the SDK Help.

  10. #10
    Registered User
    Join Date
    Aug 2010
    Posts
    43

    Re: How to display SMS in my application ?

    I am getting the error after i have deleted the array and the function (DoActivateL) is over.

    Code:
    void CHiddenSMSListBoxView::DoActivateL( 
    		const TVwsViewId& /*aPrevViewId*/,
    		TUid /*aCustomMessageId*/,
    		const TDesC8& /*aCustomMessage*/ )
    {
    	SetupStatusPaneL();
    	
    				
    	if ( iHiddenSMSListBox == NULL )
    		{
    		iHiddenSMSListBox = CreateContainerL();
    		iHiddenSMSListBox->SetMopParent( this );
    		AppUi()->AddToStackL( *this, iHiddenSMSListBox );
    		} 
    	
    	CSMSTestAppUi* iSMSTestAppUi = static_cast<CSMSTestAppUi*>(iAvkonViewAppUi);
    	TInt folderid = iSMSTestAppUi->BinaryToInt(iSMSTestAppUi->iFolderId);
    	iSMSTestAppUi->log(_L("\nDoActivateL, folderId= "));
    	iSMSTestAppUi->log(iSMSTestAppUi->iFolderId);
    	CArrayFixFlat<TArrayElements>* array;
    	array = new CArrayFixFlat<TArrayElements> (1);
    	iSMSTestAppUi->iSmsHandler->ReadHiddenFolders(folderid,array);
    	
    	TBuf<256> iIteamtext;
    	TInt count=array->Count();
    	iIteamtext.AppendNum(count);
    	iSMSTestAppUi->log(_L("\nDoActivateL, Count= "));
    	iSMSTestAppUi->log(iIteamtext);
    	for(TInt i=0;i<count;i++)
    	{
    		iIteamtext.Zero();
    		iIteamtext.Copy(_L("1\t"));
    		iIteamtext.Append(array->At(i).ismsNumber);
    		iIteamtext.Append(_L("\t"));
    		iIteamtext.Append(array->At(i).ismsText);
    		iIteamtext.Append(_L("\t"));
    		iIteamtext.Append(array->At(i).iTmsvId);
    		iSMSTestAppUi->log(_L("\nDoActivateL, iIteamtext= "));
    		iSMSTestAppUi->log(iIteamtext);
    		iHiddenSMSListBox->AddListBoxItemL(iHiddenSMSListBox->ListBox(),iIteamtext);
    	}
    	
    	
    	if(array)
    		delete array;
    	iSMSTestAppUi->log(_L("\n\nEnd of DoActivateL"));
    	
    }
    In the log file, i did get the "End of DoActivateL" log.
    But that was the last log that i got.
    Last edited by wizard_hu_; 2010-09-24 at 13:58. Reason: [CODE]...[/CODE]

  11. #11
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: How to display SMS in my application ?

    Do you have an icon array set? Remember that icons are numbered from 0, so if you have a single icon, 1 is already out of range.

  12. #12
    Registered User
    Join Date
    Aug 2010
    Posts
    43

    Re: How to display SMS in my application ?

    I am using

    icons = new (ELeave) CAknIconArray( 0 );

  13. #13
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: How to display SMS in my application ?

    That is an empty array so far, no index is going to be valid for that.
    Two things:
    - note that iTmsvId (what you append at the end) is also used as icon index, it can not work - even if you have some icons in the array
    - if you do not have icons, you might find it easier to experiment with an icon-less listbox at the first time (CAknDoubleStyleListBox for example)
    In both cases comment the line appending iTmsvId.

  14. #14
    Registered User
    Join Date
    Aug 2010
    Posts
    43

    Re: How to display SMS in my application ?

    Hi,
    thanks.
    It worked when i commented this:
    iIteamtext.Append(array->At(i).iTmsvId);

    I want to append the TmsvId arguement to the string that is passed in the AddListBoxItemL, is there any method to do so?
    I am using CAknDoubleStyleListBox
    Thanks
    Last edited by PallaviMajgaokar; 2010-09-28 at 10:15.

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: How to display SMS in my application ?

    If you want it to be displayed, you can append it, just do not use a tabulator (append a space, or a hyphen, or both).
    If you do not want it to be displayed (but you want to use it later) you should store it in an other array.

Similar Threads

  1. Replies: 2
    Last Post: 2007-06-25, 23:49
  2. How to receive SMS that was sent from our own application?
    By ronaldwh in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2007-05-08, 10:54
  3. Replies: 1
    Last Post: 2005-12-01, 23:57
  4. about sms application
    By hanyen83 in forum General Messaging
    Replies: 2
    Last Post: 2004-02-25, 17:24
  5. Run SMS Application
    By anupamforu in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-30, 06:40

Posting Permissions

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