Moving from a datafield to an app

Former Member
Former Member
Hi,
I have done a datafields app, but as I wanted to use Communication, and wanted to avoid memory issue, I'm trying to pass it in app.

But I encounter some problems for having the behaviours that are implied in a datafield.

For example the compute(info) method, I try to call it in my onupdate(dc), but this one seems to be called only once.

I start an activity recording, but the info.elapsedTime didn't increase, and so on.

Then, does it exist a standard and simple way, or guidelines to do this ?

Thanks
  • One thing different in a device app vs a DF, is that in a device app, onUpdate() isn't called for you on a regular basis. In a DF, it's every second when visible.

    In a device app, what you can do is set up a one second timer, and when the timer fires, call Ui.requestUpdate(). Without this, onUpdate() is only called once, which seems to be what you're seeing.
  • Former Member
    Former Member over 8 years ago
    Ok, thanks,
    by adding a timer, it works .
    I believed there was already an existing one, but this seems not to be the case.

    Anyway with my timer, this is good now.

    Thanks
  • Nope - no default update timer for a device-app. In this case you likely want a 1 sec timer, but I've done apps where I use 1 minute, and others where the Ui.requestUpdate() is not timer based, but is done based on a button press/swipe/receipt of data from a comm request, etc.