App status is always NOT_INSTALLED

Hi folks,

I connected the Connect IQ simulator to my Android via ADB to understand how to send data to my first watch app.

In the android app I get the device but the app status will always be "NOT_INSTALLED". The ID of the Garmin App in the android code is the same as in the garmin manifest.

Can anyone help me out with this?

With kind regards

connectIQ.getApplicationInfo("6ece9e2ef1e049ee8b9a7cd93c4e6e38", device, new ConnectIQ.IQApplicationInfoListener() {
@Override
public void onApplicationInfoReceived( IQApp app ) {
if (app != null) {
Toast.makeText(context, ""+app.getStatus(), Toast.LENGTH_LONG).show();
openGarminApplication(connectIQ, device, app);
if (app.getStatus() == INSTALLED) {
if (app.version() < 0) {
Toast.makeText(context, "App too old", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(context, "App Found", Toast.LENGTH_LONG).show();
sendMessageToGarmin(connectIQ, device, app);
}
}
}
}

@Override
public void onApplicationNotInstalled(String s) {
// Prompt user with information
Toast.makeText(context, "App Not Found", Toast.LENGTH_LONG).show();
}
});
  • I'm also having the same problem.
    Did you find a solution or the cause of the problem ?

  • Hi, it's working now, but unfortuanetly I can't remember the exact fix.

    Here's the android code, not polished yet, but working for test purposes.

    Let me know if you need further information.

    private void initConnectIq(Context context){
    connectIQ = ConnectIQ.getInstance(context, ConnectIQ.IQConnectType.WIRELESS);
    setStatus(STATUS.WORKING, appContext.getString(R.string.message_garmin_initializing));
    connectIQ.initialize(App.getContext(), true, new ConnectIQ.ConnectIQListener() {

    @Override
    public void onSdkReady() {
    setStatus(STATUS.IDLE, null);
    }

    @Override
    public void onInitializeError(ConnectIQ.IQSdkErrorStatus iqSdkErrorStatus) {
    // Error Message should be handled by autoUI = true
    setStatus(STATUS.IDLE, null);
    }

    @Override
    public void onSdkShutDown() {

    }

    });
    }

    public void uploadMessage(@NonNull Workout workout) {
    setStatus(STATUS.WORKING, appContext.getString(R.string.message_garmin_connecting));
    garminDevice = findConnectedDevice(connectIQ);
    if(garminDevice == null) {
    setStatus(STATUS.ERROR, appContext.getString(R.string.message_garmin_error_no_connected_device));
    return;
    }

    try {
    connectIQ.getApplicationInfo(GARMIN_APP_ID, garminDevice, new ConnectIQ.IQApplicationInfoListener() {
    @Override
    public void onApplicationInfoReceived(IQApp iqApp) {
    if(iqApp != null) {
    garminApp = iqApp;
    startUploadTask();
    } else {
    setStatus(STATUS.ERROR, appContext.getString(R.string.message_garmin_error_no_app));
    }
    }

    @Override
    public void onApplicationNotInstalled(String s) {
    setStatus(STATUS.ERROR, appContext.getString(R.string.message_garmin_error_no_app));
    }
    });
    } catch (InvalidStateException | ServiceUnavailableException e) {
    e.printStackTrace();
    }
    }

    @Nullable
    private static IQDevice findConnectedDevice(@NonNull final ConnectIQ connectIQ){
    List<IQDevice> connectedDevices = new ArrayList<>();
    try {
    connectedDevices = connectIQ.getConnectedDevices();
    } catch (InvalidStateException | ServiceUnavailableException ignore) { }
    if(connectedDevices != null && connectedDevices.size() > 0)
    return connectedDevices.get(0);
    else
    return null;
    }
  • Something is not alright.
    If i connect a real device with the IQ simulator i need to use ConnectIQ.IQConnectType.TETHERED in the ConnectIQ.getInstance method. Othwerwise the app don't see the simulator instance.


    Appart from that the code i use is almost identicall to yours.

    Another strange thing is that when i use the 
    ConnectIQ.sendMessage method the message is received correctly by the app i run on the IQ simulator. While the ConnectIQ.openApplication method return APP_IS_NOT_INSTALLED.

  • Another strange thing is that when i use the ConnectIQ.sendMessage method the message is received correctly by the app i run on the IQ simulator. While the ConnectIQ.openApplication method return APP_IS_NOT_INSTALLED.

    Same for me. The user has to open the app himself. openApplication is not working properly. I can only assume that this issue is gone when the app is being published and registered with its ID...

  • openApplication is not working properly. I can only assume that this issue is gone when the app is being published and registered with its ID...

    You can publish your app without making it available to end users, for the purposes of testing app settings (and this sort of thing, I assume):

    https://developer.garmin.com/connect-iq/core-topics/beta-apps/

    Connect IQ beta apps allows developers to test app settings and Garmin Connect integration in production without releasing the app.

    Uploading a beta app will let you stage your app in production. To use this feature, you will need to create an alternate app id in your manifest using a UUID creator. Beta apps will show up in your uploaded apps, and you can download them to your Garmin device. Once downloaded you can edit app settings in Garmin Connect and Garmin Express and test your developer fields in Garmin Connect. After you upload the beta app, you can update the beta version as many times as you want. When you are ready to release the app, change the app id to your production version in the manifest and upload it without checking the “Beta App” checkbox. Note that the app will have a separate store identifier from your final app, and URLs to the beta will not be visible outside of your account.