Simulator vs real device

I've mostly been developing my app (for the Edge 530) on the simulator but took the real device out for a spin today. For some strange reason, I got the values for current/average power fine but current/averge speed and distance didn't show up even with an active session (and GPS OK). My app has pretty much all permissions you can image since I sideload it anyway. The data shows up fine with simulator random FIT data. Any theories what could result in 0-data for speed/distance? GPS not active, after all?

  • You have to enable GPS.  It's not on for your app right now.

    The sim is different when you simulate/play back a .fit

    You'll want CONTINUOUS if you expect that data in the .fit.  ONE_SHOT is just that.  Grabs the location once and then turns off GPS.

  • Ah, thanks for the clarification. So I have to do the speed-stuff parallel to the getActivityInfo()? Or does the simple fact that the CONTINOUS is requested, the currentSpeed is populated (since GPS is found to be always on)?

    "Why doesn't he just try it himself?" you are asking. Well, there is a 15-year-old sitting on the home computer where I can deploy to the real device since my employer has enforced McAffee encryption for external USB storage on my work laptop and somehow I don't think it's a good idea to encrypt the real device ;-)

  • Ngh. I do in initialize() a 

    System.println("!init");
    Position.enableLocationEvents(Position.LOCATION_CONTINUOUS, method(:gpsTickle));
    System.println("init!");

    with a 

    function gpsTickle(info) {
    System.println(info.position.accuracy + "!");
    }

    And I see the two init confirmations but the callback never fires...

  • If it's the sim, you need to simulate daya or playback a fir.  If it's on a real device it can take a while for GPS to get going (go outside to speed things up)

  • Thanks for your help, got it working now! Apparently it's enough to request the continuous updates and the Activity.Info currentSpeed etc will be updated automagically