×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Sep 2008
    Location
    India
    Posts
    126

    How to get lat-log ?

    I am using following code to get lat-long :

    // It is used to make the primary connection to the location
    server.
    RPositionServer server;
    User::LeaveIfError(server.Connect());
    CleanupClosePushL(server);

    //To create a sub-session with the server for the purpose of
    obtaining the current position.
    RPositioner positioner;
    User::LeaveIfError(positioner.Open(server));
    CleanupClosePushL(positioner);

    const TDesC& KAppNm=_L("myApp");
    positioner.SetRequestor(CRequestor::ERequestorService ,
    CRequestor::EFormatApplication , KAppNm);

    // Issue a Location Request
    TRequestStatus status;
    TPositionInfo posInfo;
    positioner.NotifyPositionUpdate(posInfo, status);
    User::WaitForRequest(status);
    User::LeaveIfError(status.Int());


    // Analyze Results
    TPosition position;
    posInfo.GetPosition(position);
    TReal64 latitude=position.Latitude();
    TReal64 longitude=position.Longitude();

    CleanupStack::PopAndDestroy(&positioner);
    CleanupStack::PopAndDestroy(&server);

    1. Can anybody tell me what I am missing in this code ?

    2. positioner.NotifyPositionUpdate(posInfo, status);

    not making status == KErrNone .

    3. Ideally what status required for User::WaitForRequest(status); ?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: How to get lat-log ?

    I would start by checking the Wiki examples, there should be ready made code for your use case, also WaitForRequest is often a bad idea, it would be a lot better idea to implement it with real Active object.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Location
    India
    Posts
    1,043

    Re: How to get lat-log ?

    Hi,
    As symbianyucca mentioned there is ready made code available in lot of forums you just need to search in right places.
    Wiki forum is one of the best places to start your search.
    For starting you can have a look into this article
    http://wiki.forum.nokia.com/index.ph..._Bluetooth_GPS
    If you want any other information use the search box in wiki I am sure it will provide you lot of valuable information within no time :-)
    Maximus
    S60 Developer
    Impossible is nothing

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,336

    Re: How to get lat-log ?

    As you are using RPosition APIs, find out suitable article from this list: Symbian C++ Location Articles
    Nokia Developer Wiki Moderation team

Similar Threads

  1. problem with thread
    By maclun123 in forum Symbian
    Replies: 3
    Last Post: 2008-09-25, 22:18
  2. Open call log view
    By martinpeterzon in forum Symbian
    Replies: 5
    Last Post: 2008-08-09, 19:30
  3. Answer Incoming Call doesn't work properly
    By mynick1000 in forum Symbian
    Replies: 37
    Last Post: 2008-05-13, 21:16
  4. Replies: 0
    Last Post: 2007-04-20, 05:54
  5. Log / Telephone Application Corrupt Log File
    By simulacara in forum Symbian
    Replies: 0
    Last Post: 2002-12-16, 23:44

Posting Permissions

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