Activate the request after hours using Acive abjects

Login to reply to this topic.
Sat, 2008-03-01 07:46
Joined: 2006-05-08
Forum posts: 79

Hi All,
i am working on a project. my requirement , i have to send the messages after one hours or 2 or 3 or 4 hours . my application is running in the background . i have used the After() function but it takes maximum
value 35min . how i can do this . please reply me if anybody knows

i am waiting for reply..


Sat, 2008-03-01 10:21
Joined: 2005-11-20
Forum posts: 1144
Re: Activate the request after hours using Acive abjects

Why not simply implement a counter for half-hours? If you have to wait e.g. for 3 hours, set the counter to 6, set the wait period for After() to half an hour, decrement the counter whenever After() returns, and if the counter is not yet zero, wait another half hour with After().


René Brunner

Sat, 2008-03-01 11:13
Joined: 2006-05-08
Forum posts: 79
Re: Activate the request after hours using Acive abjects

Thanks for reply..
please tell me in detail. i am Waiting for you reply..

void CScheduleTimer::RunL()
{
if (iStatus == KErrNone )
{
if(CheckScheduleL())
{
iXMLEngine = CXmlController::NewL(this);
iXMLEngine->iLocation = iSmsHandler->iDatabase->GetLocation();
iXMLEngine->GenerateXML(ELocationMessage);
}

After(iInterval);
}
else
CActiveScheduler::Stop();
}

void CScheduleTimer::ConstructL(CSmsHandler *iSmsHandler, TTimeIntervalMicroSeconds32 aInterval)
{
CActiveScheduler::Add(this);
iTimer.CreateLocal();
this->iInterval = aInterval;
iXMLEngine = NULL;

this->iSmsHandler = iSmsHandler;

After(iInterval);
}

void CScheduleTimer::After(TTimeIntervalMicroSeconds32 aInterval)
{
Cancel();
iTimer.After(iStatus,aInterval);
SetActive();
}

i am getting iInterval from database...

please tell me what i can do ..value may be 45min 2 hous ,30 min 5 min,,,

Sat, 2008-03-01 12:23
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 1913
Re: Activate the request after hours using Acive abjects

Create your own timer class which encapsulate the call to RTimer and do as RBrunner wrote (i.e. split the time to wait in 35minutes chunk and add a counter). I have done this for one project and it works very well.


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Sat, 2008-03-01 13:08
Joined: 2004-07-17
Forum posts: 110
Re: Activate the request after hours using Acive abjects

Alternatively your can use RTimer::At() for long delays (e.g. Alarms).

Tue, 2008-03-04 00:06
Joined: 2007-09-23
Forum posts: 151
Re: Activate the request after hours using Acive abjects

Why have a timer that goes off every 1/2 hour and then do some calculation when as fig7 says you can use At()?

Tue, 2008-03-04 04:53
Joined: 2008-03-04
Forum posts: 2
Re: Activate the request after hours using Acive abjects

RTimer::At() is really useful. I used it to launch a request at a particular time,and also my application ran in background.My CMyTimer::Start(TTime& aTime) function ws like this:
{
......
At(aTime);
......
}
And at the right time to user iMyTimer->Start(time); then it will go into the RunL() function to do the required job.

  • Login to reply to this topic.