×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2005
    Location
    Vadodara, Gujarat (INDIA)
    Posts
    29

    How do I keep Console application running?

    Hi,

    I have created a console application which will autostart when the device reboots. (using Startup List Management API)

    I have created a CConsoleBase object in it. Now, the main functionality of this application is to receive SMS.

    I have created a class which inherits from MMsvSessionObserver and I have implemented the HandleSessionEventL() method of MMsvSessionObserver class.

    I have used console object and used it as follows to keep the application running. Look at the following method...

    void MainL()
    {
    //create an object which will receive the SMS...
    CICESMSObserverClass *ReceiveSMS = CICESMSObserverClass::NewL(console);

    console->Write(_L("Hello, world!\n"));
    TKeyCode k = console->Getch();
    while(EKeyDevice0 != k)
    {
    if(k == EKeyDevice0)
    {
    if(ReceiveSMS)
    delete ReceiveSMS;
    break;
    }
    else
    k = console->Getch(); //Keep the application waiting here...
    }

    Now the problem is...
    1.) I am not able to receive the SMS. (Please see the application is waiting at the last line above)
    2.) What is the flow of the execution when the SMS arrives. There is no other thread running...
    3.) I don't want console in my application. I don't need the console or in other words I don't want any UI for this application. So, the above approach needs to be changed in the production version. So, how do I keep my application running without the console?
    4.) What if I put an infinite while() loop? I don't want my application to terminate at all. It will be running continuously. What is the best design for this implementation?

    Your help and time is much appreciated.
    Best Regards,
    Mehul Patel
    Software Developer.
    (Palm OS, Symbian & Windows Mobile)

  2. #2
    Super Contributor
    Join Date
    Jun 2006
    Location
    Moscow, Russia
    Posts
    803

    Re: How do I keep Console application running?

    If you do not need the console then just don't create it

    Please see the Wiki article Sending-Receiving SMS through an Exe. Hope it will help you
    Regards,
    ivey

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Vadodara, Gujarat (INDIA)
    Posts
    29

    Re: How do I keep Console application running?

    Thanks for the suggestion...
    Yes, I am going to remove the console at the end. That is kept just to print error messages and other log.
    Best Regards,
    Mehul Patel
    Software Developer.
    (Palm OS, Symbian & Windows Mobile)

Similar Threads

  1. Error in Running Application In Nokia E62 Device
    By blackspear in forum Mobile Java General
    Replies: 1
    Last Post: 2007-03-08, 05:25
  2. symbian signed testing problem.
    By anglina in forum Symbian
    Replies: 0
    Last Post: 2007-02-01, 10:15
  3. Sending data with application running in the background
    By wedoi in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2004-11-28, 21:36
  4. Replies: 0
    Last Post: 2004-10-26, 15:02
  5. Trouble while running Application
    By manishfulambarkar in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-12-22, 12:43

Posting Permissions

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