App misbehaving on ForeRunner 935. Fine on simulator

Hi,

I have a watch app which works fine on a couple of watches, but on a 935 it misbehaves.  It's mean to draw lines on the screen, which are downloaded as a json file. This constitutes a map.

It works in the simulator, but on the watch the screen is blank and having got some debug logs off the watch itself, I get a strange output and hoped someone might be able to shed some light.

Each json file has an ID which is a string. This string is number/number/number (eg. 32754/25849/17) respresenting a map tile location

I print the current tiles which are being displayed. The code to populate the tile ids is:

var tiles = new [totalTilesX * totalTilesY];

var x = topLeftTileX;
var i = 0;
while(x <= bottomRightTileX){
var y = topLeftTileY;
while(y <= bottomRightTileY){
tiles[i]= x + "/" + y + "/" + z;
i++;
y++;
}
x++;
}

return tiles;

Then, later on, the code to print the ids

System.println(tiles);

On the 935 Simulator, and on my watch (vivoactive) and a fenix it prints the strings when I print the array.

[32739/25972/17, 32739/25973/17, 32739/25974/17, 32740/25972/17, 32740/25973/17, 32740/25974/17]

On the watch where it doesn't work, when I print the array of values, it prints

[f.a.q.b.l@92a741b2, f.a.q.b.l@92a7b611, f.a.q.b.l@92b1b63b, f.a.q.b.l@86f0b2d1, f.a.q.b.l@86f12730, f.a.q.b.l@86fb275a, f.a.q.b.l@7b3a23f0, f.a.q.b.l@7b3a984f, 
  • You want to do the whole screen in onUndate if you want it to look consistent. You probably have a timer to update the screen and you might try changing that from every second to every 2 and do it all.  There still could be a delay, but that way it's consistent and not a mix.

  • Couple more minor UX issues:

    - When I press the UP and DOWN buttons I expect the screens to slide down and up. (I assume the corresponding touchscreen gestures would be swipe down and swipe up, as swipe right usually means "go back" or "exit")

    - On a button-based watch, a series of screens (like data pages or menus) usually "wraps around" (i.e. if you press DOWN on the last page, you're taken to the first page.) I realize that it probably doesn't work this way on a touchscreen watch -- I know that the Menu2 control reflects these differences (it wraps on a button-based watch, but it doesn't wrap on a touchscreen watch)

    (Note that if you support the original Vivoactive watch, then the swipe actions for "previous page" / "next page" are actually swipe right / swipe left, and vertical swipes aren't even supported)

  • My concern was that the run timer then doesn't tick (minor, but I found it annoying).

    Is my concern that running an expensive operation every second drains battery a valid one? I'm not sure whether the hardware accounts for lack of work to do by reducing clockspeed or similar. Perhaps updaing every second is fine.

  • My concern was that the run timer then doesn't tick (minor, but I found it annoying).

    I'm guessing the user would want to see the run timer tick once per second (imo).

  • This is what I get now:

    [$X/${Y}/17, $X/${Y+1}/17, $X/${Y+2}/17, ${X+1}/${Y}/17, ${X+1}/${Y+1}/17, ${X+1}/${Y+2}/17]
    loading tile:https://maps.creativefootprint.co.uk/api/tiles/$X/${Y}/17
    loading tile:https://maps.creativefootprint.co.uk/api/tiles/$X/${Y+1}/17
    loading tile:https://maps.creativefootprint.co.uk/api/tiles/$X/${Y+2}/17
    loading tile:https://maps.creativefootprint.co.uk/api/tiles/${X+1}/${Y}/17
    loading tile:https://maps.creativefootprint.co.uk/api/tiles/${X+1}/${Y+1}/17
    received response code:-101
    Too many requests in the queue
    loading tile:https://maps.creativefootprint.co.uk/api/tiles/${X+1}/${Y+2}/17
    received response code:-101
    Too many requests in the queue
    Tile stats: loadedFromStorage=0, savedToStorage=0, loadedFromWeb=81
    received response code:-200
    Error requesting map:-200
    total points in all tiles:0
    pointCounts:{}
    types To Render:[]
    received response code:-200
    Error requesting map:-200
    received response code:-200
    Error requesting map:-200
    received response code:-200
    Error requesting map:-200
    total points in all tiles:0
    pointCounts:{}
    types To Render:[]
    route Id not set. Not loading route
    

    Are you at all surprised I'm not seeing your original problem?

  • That's a good spot. My code to change the view is:

    WatchUi.pushView(dataView,
    new DataDelegate(dataView, mSessionManager, MapperApp.DATA_VIEW_1_ID),
    WatchUi.SLIDE_LEFT);

    but on a button watch I need to change this to SLIDE_DOWN/UP, I guess. 

  • I'd add a println to make sure the timer is changing as you expect and the screen is updating as you expect.

    And if you only update say every 10 seconds, just show the minutes. and not the seconds.  It all depends on how you want to try to save battery.

  • Why wouldn't you want it to slide down and up on a touchscreen watch?

    Are you actually using swipe left and right to switch screens?

    Do you have an original Vivoactive or a newer one?

    I believe every touchscreen watch except the original Vivoactive uses swipe down and up for the previous / next actions.

    How do your watch's native menus and activities work? (Vertical swipes/slides or horizontal swipes/sllides to scroll?)

  • I suspect this was the problem all the time. I added a toString() to the ID in case that fixed it (but it appears to just fix the printing). I'd actually forgotten that I'd done that until you mentioned it.

    So, -200

    INVALID_HTTP_HEADER_FIELDS_IN_REQUEST -200

    1.0.0

    Request contained invalid http header fields.

    so I'm doing something stupid I would guess.

    The simulator doesn't do this. Could it be a null field in the request. Perhaps the API key (which is now not set)

  • I believe every touchscreen watch except the original Vivoactive uses swipe down and up for the previous / next actions.

    https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/BehaviorDelegate.html#onNextPage-instance_function

    onNextPage()Toybox.Lang.Boolean

    Represents the Next Page behavior.

    This is typically triggered by the down button (KEY_DOWN) or by a SWIPE_UP SwipeEvent on a touch screen.

    onPreviousPage()Toybox.Lang.Boolean

    Represents the Previous Page behavior.

    This is typically triggered by the up button (KEY_UP) or by a SWIPE_DOWN SwipeEvent on a touch screen.