×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    6

    Question Get Speed from GPS

    Hey everybody!

    I'm looking for a possibility to get the current Speed from GPS in a WRT-Widget.

    Is this possible anyway?


    David from Germany
    Last edited by .david.; 2010-02-17 at 08:43.

  2. #2
    Registered User
    Join Date
    Sep 2009
    Posts
    6

    Re: Get Speed from GPS

    Hey, I've now found a code to get the HorizontalSpeed from GPS.
    Well longitude and latitude works fine but the speed doesn't work, it shows always "undefined" or "NaN".

    Here's my code:
    var lat = 0; //aktuelle eigene Position
    var lon = 0;
    var speed = 0;
    var GPS_av = 0;
    var locationService = device.getServiceObject("Service.Location", "ILocation");


    if (widget.isrotationsupported) widget.setDisplayPortrait(); //Hochformat
    window.menu.hideSoftkeys(); //Fullscreen




    function startGPS()
    {

    criteria = new Object();
    criteria.LocationInformationClass = "GenericLocationInfo";
    criteria.Updateoptions = new Object();
    criteria.Updateoptions.UpdateInterval = 1000000; //1 sek.
    criteria.Updateoptions.UpdateTimeOut = 15000000; //15 sek.
    criteria.Updateoptions.UpdateMaxAge = 0;
    criteria.Updateoptions.PartialUpdates = false;

    result = locationService.ILocation.Trace(criteria, handleGPS);

    }

    function handleGPS(transId, eventCode, result){ //GPS-Daten verarbeiten, wird jede Sekunde ausgeführt
    if (eventCode != 4) { //GPS bestimmt
    GPS_av = 1;
    lon = result.ReturnValue.Longitude;
    lat = result.ReturnValue.Latitude;
    speed = result.ReturnValue.HorizontalSpeed;

    document.getElementById('lon').innerHTML = lon;
    document.getElementById('lat').innerHTML = lat;
    document.getElementById('speed').innerHTML = speed;

    sendGPS(lon, lat, speed);

    }
    else alert("GPS-Tracking Error");
    }

    function getSpeed(){
    document.getElementById('lon').innerHTML = lon;
    document.getElementById('lat').innerHTML = lat;
    document.getElementById('speed').innerHTML = speed;

    }
    So have anybody any idea why the speed never works?

    And I've got an other Problem, a friend developed a WRT-Widget which needs GPS, he tested on his N97, now he tested on a N86, on the N97 the device asks if the widget is allowed to use GPS, but on the N86 the widget never asks to use GPS, so GPS doesn't work, also the N86 never prints an error or something else.

    I hope you can understand what i want to explain ...


    Sorry for my bad school English from Germany ...
    David
    Last edited by .david.; 2010-02-17 at 08:36.

  3. #3
    Registered User
    Join Date
    Sep 2009
    Posts
    6

    Re: Get Speed from GPS

    Sorry for double Post, but have nobody an idea why i don't get a speed?

    Greetings
    David

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    3

    Re: Get Speed from GPS

    Hi David,

    I'm having the same problem with my E71 trying to get speed and course from within a midlet.
    I have read that setting the criteria.setSpeedAndCourseRequired(true); would do the trick. But that did not work for me. Anybody out there, who can assure, that the E71 GPS speed and course values are accessible via Java?

Similar Threads

  1. GPS Listener - different behavior in emulator
    By neil.young in forum Symbian
    Replies: 4
    Last Post: 2009-12-15, 08:59
  2. GPS Heading, course, speed
    By seznam.cz in forum Symbian
    Replies: 4
    Last Post: 2009-10-29, 13:29
  3. speed from GPS show wrong value
    By samosnokia in forum Symbian
    Replies: 13
    Last Post: 2009-06-25, 19:19
  4. GPS Speed.
    By ManuMies in forum Symbian
    Replies: 2
    Last Post: 2007-11-07, 08:18

Posting Permissions

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