Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User sandeepmhptr3's Avatar
    Join Date
    Nov 2012
    Posts
    34
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,743
    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 sandeepmhptr3's Avatar
    Join Date
    Nov 2012
    Posts
    34
    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 wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    27,743
    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
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved