Vivoactive HR - Sys.exitTo(intent) fails to open another CIQ app

This post is related to these threads:
https://forums.garmin.com/forum/deve...pleteexception
https://forums.garmin.com/forum/deve...on-va-hr/page2

I hope this time we manage to understand each other.

Here is a complete code to reproduce the problem. Just copy, paste, compile, upload and install on a real VAHR.

I'm using Toybox.System.exitTo(intent) to open another app I have (not a native app). It fails (hangs?) on the Vivoactive HR. Nothing happens on a first try, and then Toybox::System::PreviousOperationNotCompleteException occurs. It works perfectly in the sim (even on the VAHR sim) and on other devices.

The manifest id in the example (CE62BDE5-05EF-41D3-8872-7D3F901317CD) is from this app:
https://apps.garmin.com/en-US/apps/a...b-25d562155e44

It could be any app from the CIQ store. Whichever app you choose, you must have it installed on the real Vivoactive HR to see the error.

using Toybox.Application as App;
using Toybox.WatchUi as Ui;
using Toybox.System as Sys;
using Toybox.Graphics as Gfx;

var errorMsg = "";

class SystemExitToVAHRFailApp extends App.AppBase {
function initialize( ) {AppBase.initialize( );}
function onStart(state) { }
function onStop(state) { }
function getInitialView( ) {return [ new SystemExitToVAHRFailView( ), new SystemExitToVAHRFailDelegate( ) ];}
}

class SystemExitToVAHRFailView extends Ui.View {

function initialize( ) {View.initialize( ); }
function onLayout(dc) {}
function onShow( ) {}
function onHide( ) {}

function onUpdate(dc) {
View.onUpdate(dc);

dc.setColor(Gfx.COLOR_BLACK, Gfx.COLOR_BLACK);
dc.clear( );
dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT);

dc.drawText(
dc.getWidth( ) / 2,
dc.getHeight( ) / 4,
Gfx.FONT_SMALL,
"Open the menu",
Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
);

dc.drawText(
dc.getWidth( ) / 2,
dc.getHeight( ) / 2,
Gfx.FONT_XTINY,
errorMsg,
Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
);

}

}

class SystemExitToVAHRFailDelegate extends Ui.BehaviorDelegate {

function initialize( ) {BehaviorDelegate.initialize( );}

function onMenu( ) {
var aMenu = new Ui.Menu( );
aMenu.setTitle("Test System.exitTo( )");
aMenu.addItem("Exit to a CIQ app", :menuOpenApp);
Ui.pushView(aMenu, new SystemExitToVAHRFailMenuDelegate( ), Ui.SLIDE_IMMEDIATE );
return true;
}

}

class SystemExitToVAHRFailMenuDelegate extends Ui.MenuInputDelegate {

function initialize( ) {
MenuInputDelegate.initialize();
}

function onMenuItem(item) {
if
(item == :menuOpenApp) {
try
{
Sys.exitTo(
new Sys.Intent(

"manifest-id://CE62BDE5-05EF-41D3-8872-7D3F901317CD",

{
"Param1" => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29],
"Param2" => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
}
)
);
}
catch (exception)
{
errorMsg = exception.getErrorMessage( );
Ui.requestUpdate( );
}
}
}
}

  • Hey,

    So I've walked through this and I'm still not seeing an error. Here is my setup:
    • Vivoactive HR - SW 4.40
    • The app you've provided
    • The app you suggested in the link


    All apps are present on the Vivoactive HR. I've attached pictures of what I'm seeing. Please let me know if I'm doing something wrong to try and reproduce. I'm simply given the option to exit to the other app and it appears that all has gone well.

    Thanks,
    - Coleman


    community.garmin.com/.../1339343.jpg
  • Coleman,

    The problem is no longer happening exactly as I described, but there's still something wrong. The target app opens, but it does not get the data sent with the intent.

    I have a complete code to reproduce the problem. (Now it's really complete, because below you have both apps: the one that sends and the one that receives the data). It's definitely working on my Fenix 5 and in the simulator, but not on my VAHR.

    This is the app that calls System.exitTo( ). You have to change the manifest id of the target app (it should the the id of the other app - see further, below):

    using Toybox.Application as App;
    using Toybox.WatchUi as Ui;
    using Toybox.System as Sys;
    using Toybox.Graphics as Gfx;

    var errorMsg = "";

    class SystemExitToVAHRFailApp extends App.AppBase {
    function initialize( ) {AppBase.initialize( );}
    function onStart(state) { }
    function onStop(state) { }
    function getInitialView( ) {return [ new SystemExitToVAHRFailView( ), new SystemExitToVAHRFailDelegate( ) ];}
    }

    class SystemExitToVAHRFailView extends Ui.View {

    function initialize( ) {View.initialize( ); }
    function onLayout(dc) {}
    function onShow( ) {}
    function onHide( ) {}

    function onUpdate(dc) {
    View.onUpdate(dc);

    dc.setColor(Gfx.COLOR_BLACK, Gfx.COLOR_BLACK);
    dc.clear( );
    dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT);

    dc.drawText(
    dc.getWidth( ) / 2,
    dc.getHeight( ) / 4,
    Gfx.FONT_SMALL,
    "Open the menu",
    Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
    );

    dc.drawText(
    dc.getWidth( ) / 2,
    dc.getHeight( ) / 2,
    Gfx.FONT_XTINY,
    errorMsg,
    Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
    );

    }

    }

    class SystemExitToVAHRFailDelegate extends Ui.BehaviorDelegate {

    function initialize( ) {BehaviorDelegate.initialize( );}

    function onMenu( ) {
    var aMenu = new Ui.Menu( );
    aMenu.setTitle("Test System.exitTo( )");
    aMenu.addItem("Exit to a CIQ app", :menuOpenApp);
    Ui.pushView(aMenu, new SystemExitToVAHRFailMenuDelegate( ), Ui.SLIDE_IMMEDIATE );
    return true;
    }

    }

    class SystemExitToVAHRFailMenuDelegate extends Ui.MenuInputDelegate {

    function initialize( ) {
    MenuInputDelegate.initialize();
    }

    function onMenuItem(item) {
    if
    (item == :menuOpenApp) {
    try
    {
    Sys.exitTo(
    new Sys.Intent(

    "manifest-id:// ??????? ", // Use the manifest id from the app below

    {
    "aLat" => 40.581449,
    "aLon" => -73.990363
    }
    )
    );
    }
    catch (exception)
    {
    errorMsg = exception.getErrorMessage( );
    Ui.requestUpdate( );
    }
    }
    }
    }


    And this is the code that should receive the data:

    using Toybox.Application as App;
    using Toybox.WatchUi as Ui;
    using Toybox.System as Sys;
    using Toybox.Graphics as Gfx;

    var m_DataFromIntent = null;

    class SystemExitToVAHRFail2App extends App.AppBase {
    function initialize( ) {AppBase.initialize( );}
    function onStart(state) {
    m_DataFromIntent = state;
    }
    function onStop(state) { }
    function getInitialView( ) {return [new SystemExitToVAHRFail2View( )];}
    }

    class SystemExitToVAHRFail2View extends Ui.View {

    function initialize( ) {View.initialize( ); }
    function onLayout(dc) {}
    function onShow( ) {}
    function onHide( ) {}

    function onUpdate(dc) {
    View.onUpdate(dc);

    dc.setColor(Gfx.COLOR_BLACK, Gfx.COLOR_BLACK);
    dc.clear( );
    dc.setColor(Gfx.COLOR_WHITE, Gfx.COLOR_TRANSPARENT);

    // On the Fenix 5 and on the sim, I see the data from the dictionary
    // { "aLat" => 40.581449, "aLon" => -73.990363}.
    // On the VAHR I don't. I see "NO DATA"
    dc.drawText(
    dc.getWidth( ) / 2,
    dc.getHeight( ) / 2,
    Gfx.FONT_SMALL,
    m_DataFromIntent == null ? "NO DATA" : m_DataFromIntent.toString(),
    Gfx.TEXT_JUSTIFY_CENTER|Gfx.TEXT_JUSTIFY_VCENTER
    );
    }
    }

  • That was just what we needed! I was able to confirm that it works in the sim and other devices. I've got it down to a consistent test case and have passed it on to the device team. We'll try to circle back when we have more info from them.

    Thanks,
    - Coleman
  • Hey. I wanted to let you know that we have a fix ready and it should be in the next device software release.

    Thanks,
    -Coleman
  • I'm also keenly awaiting this fix and have requested a delivery schedule for the fix on the VA-HR. I can confirm it's not in 4.40
  • Hey. I wanted to let you know that we have a fix ready and it should be in the next device software release.

    Thanks,
    -Coleman



    To overcome the memory limitations of CIQ2 (only 124kB), I have to split my application into two, so the ability to reliably pass data to the receiving app is vital for my re-engagement with Garmin.

    A lot rides on it being included in the VA-HR release promised "November-December"

    Can you provide some reassurance on that front please?


  • I'm pleased to be able to report that SW 5.00 for the VA_HR now supports exitTo() passing arguments to the receiving app.