×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    25

    How to get Speed in Positioning App?!

    I used this:
    Code:
    float speed = location.getSpeed()* 3.6f; //ms -> km/h
    to get Speed in my app but it doesn't work. It returns "NaN", what is that?
    Can you guys help me? Thanks.

  2. #2
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: How to get Speed in Positioning App?!

    Hello beobeo796,

    according to Javadocs for JSR-179, the getSpeed() returns "the current ground speed in m/s for the terminal or Float.NaN if the speed is not known".

    Which device are you using for testing this?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  3. #3
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,569

    Re: How to get Speed in Positioning App?!

    Quote Originally Posted by beobeo796 View Post
    "NaN", what is that?
    And, in case you don't know: NaN = Not a Number, which means it is an undefined or unrepresentable value.

  4. #4
    Registered User
    Join Date
    Sep 2009
    Posts
    25

    Re: How to get Speed in Positioning App?!

    Thanks for your help.
    I used my E71 for the test. So now how can i fix it? Can you help me?

  5. #5
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: How to get Speed in Positioning App?!

    when defining the Criteria you are using you might want to set the following method :
    setSpeedAndCourseRequired(boolean speedAndCourseRequired)
    Sets whether the location provider should be able to determine speed and course.

    Also have a look at the JSR-179 documentation and/or Javadoc !

Similar Threads

  1. Demo app on OVI Store, user activates app through publisher's website, possible?
    By marksmithdev in forum [Closed] Publishing to Nokia Store
    Replies: 1
    Last Post: 2010-03-28, 15:06
  2. speed from GPS show wrong value
    By samosnokia in forum Symbian
    Replies: 13
    Last Post: 2009-06-25, 19:19
  3. App Launch Speed
    By mreaves in forum Mobile Java General
    Replies: 0
    Last Post: 2007-03-07, 15:27
  4. Dialog's clipping area (again). Nokia experts, please help
    By synov in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-06-26, 14:35

Posting Permissions

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