DataField shown on simulator not in watch

Former Member
Former Member
Hi,

My first Connect IQ shows and run great in simulator but on watch show IQ with an admiration symbol, some suggestion?
This is a DataField, not simple, but in simulator show and run great on all layouts.
Thanks in advance,
Carlos.
  • Be sure you're building the app for the correct device. In Eclipse, choose "Build Project for Device" from the Connect IQ menu, and set the project for your specific device. If your device is not listed, right click on your project in the Project Explorer, choose Properties, select Connect IQ, and then set the appropriate Target Platforms.
  • Former Member
    Former Member over 10 years ago
    It could also be that there's a bug preventing the app from starting. For instance if you didn't start an activity, you'll get null values for properties on the info object (possible null reference error). There's also situations that don't come up in the simulator. For instance an active activity where you're standing still (possible devide by zero error).
  • Former Member
    Former Member over 8 years ago
    DataField shown on simulator not in watch

    It could also be that there's a bug preventing the app from starting. For instance if you didn't start an activity, you'll get null values for properties on the info object (possible null reference error). There's also situations that don't come up in the simulator. For instance an active activity where you're standing still (possible devide by zero error).


    Hi

    I am facing a similar issue. I have a datafield app which works fine in the simulator but i when i sideload it on my garmin forerunner230, i get the "IQ!" symbol. I tried narrowing down the issue and see that it happens only when i use the division operation. I made sure that the divisor is not zero but even then i see the same issue. Here is the snippet of the code. The line pointed by the arrow with the divide operation is causing the issue. It works fine if i select the speedType to "SPEED" where it uses a multiply operation. I even added an if statement as shown which checks that the divisor is not zero. The memory utilization in the simulator shows it as 7.1KB/16KB, so i believe there is no issue with memory utilization. I tried almost everything i could think of but just don't understand why the divide operation doesn't work. Any inputs would be highly appreciated. Thanks.

    function compute(info)
    {
    var currentSpeedMs = info.currentSpeed;

    if( info.currentSpeed != null )
    {
    if(speedType == SPEED) {
    speed = info.currentSpeed*2.237; //convert from m/s to miles/hour
    }else { //PACE
    if(currentSpeedMs > 1.0) {
    speed = 26.8224/currentSpeedMs; // <--------This is the operation that is causing the issue.
    }
    }
    }
    }
  • I'm not seeing anything obvious (you are checking for null and avoiding divide by zero). As far as I can tell, that code should not be a problem and you should have a look somewhere else.

    It is probably a good idea to start logging the values that might be causing problems. Instructions to setup logging are found in the FAQ. You can print the values and tracing information to tell where the problem is.

    Let us know what you find. I'm curious if I'm missing something.

    Travis
  • Former Member
    Former Member over 8 years ago
    DataField shown on simulator not in watch

    I'm not seeing anything obvious (you are checking for null and avoiding divide by zero). As far as I can tell, that code should not be a problem and you should have a look somewhere else.

    It is probably a good idea to start logging the values that might be causing problems. Instructions to setup logging are found in the FAQ. You can print the values and tracing information to tell where the problem is.

    Let us know what you find. I'm curious if I'm missing something.

    Travis



    Thanks Travis for your response. I think i found the issue. There is a missing else statement when i check if the currentSpeedMs >0. So i believe upon start up the condition is not satisified and the "speed" variable is null. So this may be throwing other variables unknown that depend on the speed. Looks like it is working fine now after adding the else statement. I will test it more.
    BTW, Do you know how to display data in different fields when we choose 2/3/4 field option. How do we distinguish between the multiple fields to display different variables? Thanks
  • BTW, Do you know how to display data in different fields when we choose 2/3/4 field option. How do we distinguish between the multiple fields to display different variables? Thanks


    As a CIQ DF, you only have access to that one data field. You can't write to the other DF's on the screen. You can run the same DF in two fields, and with a complex DF (you're currently using a Simple one), you can kind of figure out which field your in, using the height/width/obscurity flags (obsurity flags only come into play for round and semi-round watches), and display different things or in a different way.
  • If you use a one field layout, onLayout() will be called once, and then onUpdate() will be called every second for that single data field. If you switch to a three field layout, onLayout() will be called for the first field, then onUpdate(). This will repeat for each data field displayed. I'm not absolutely certain, but I believe that actual devices behave this way as well.

    This means that you can use the simulator to test the code for each of the different layout positions and shapes supported by each device, possibly testing several of them at the same time.

    Travis