×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Nov 2012
    Posts
    34

    how to add a delay of 15 minutes to a looop?appended the code!!!

    Code:
    TBool CGpsPositionRequest::GetCurrentPostionL(TReal& aLatitude, TReal& aLongitude)
        {
        // cancel previous request (just in case)
        Cancel();
        // request current location
        iPositioner.NotifyPositionUpdate(iPositionInfo, iStatus);
        SetActive();
        // start wait note and wait for request end
        ShowWaitNoteL();
        // process result
        if (iError == KErrNone)
            {
            // success, return given position
            TPosition pos;
            iPositionInfo.GetPosition(pos);
            aLatitude = pos.Latitude();
            aLongitude = pos.Longitude();
           
            return ETrue;
            }
        // fail
        return EFalse;
        }
    
    void CGpsPositionRequest::RunL()
        {
        // request ended, store error code and dismiss wait dialog
    	if(flg)
    		{
        iError = iStatus.Int();
        DismissWaitNote();
        flg=false;
        Cancel();
        	 iTimer.After(iStatus,5000000000000);// HERE i WANT A DELAY OF 15 MINUTES
        	 SetActive();
    		}
    	if(!flg)
    		{
    		iloc->getGPSLocation();
    		}
    	
        }
    
    getGPSLocation()
    {
    
       result= request->GetCurrentPostionL(latitude, longitude); 
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,567

    Re: how to add a delay of 15 minutes to a looop?appended the code!!!

    You can use the same active object, just create an RTimer member and use its After method.
    And of course you will need a status variable tracking what the AO is waiting for (GPS result or the timer). Set the variable when issuing the request, and check it in RunL to decide what to do.

  3. #3
    Registered User
    Join Date
    Nov 2012
    Posts
    34

    Re: how to add a delay of 15 minutes to a looop?appended the code!!!

    I changed the runl and it run s fine

    void CGpsPositionRequest::RunL()
    {
    // request ended, store error code and dismiss wait dialog
    if(flg)
    {
    iError = iStatus.Int();
    DismissWaitNote();
    flg=false;
    Cancel();
    iTimer.After(iStatus,60000000);
    SetActive();
    return;
    }
    if(!flg)
    {
    iloc->getGPSLocation();
    flg=true;
    }

    }

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,567

    Re: how to add a delay of 15 minutes to a looop?appended the code!!!

    Yes, that is it. Note that while it will not cause any problems, the Cancel() call is not needed in this context.

Similar Threads

  1. blank vector item appended to a LWUIT list
    By ali30 in forum Mobile Java General
    Replies: 1
    Last Post: 2012-03-19, 20:33
  2. Replies: 1
    Last Post: 2011-10-04, 13:26
  3. extra content-type appended, why ?
    By habibs in forum Mobile Java General
    Replies: 2
    Last Post: 2009-11-03, 18:24
  4. Remove appended ':' symbol in form control
    By bnpawar in forum Symbian C++
    Replies: 1
    Last Post: 2009-11-03, 15:37
  5. DateField and minutes 00
    By sambarza in forum Mobile Java Tools & SDKs
    Replies: 5
    Last Post: 2006-08-15, 20:25

Posting Permissions

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