How to deal with low-memory devices

Hi,

On my quest to support more and more devices I have taken on the FR745 this evening. It seems that on the FR745 there is less memory available for glances than on other glance devices I tested so far (Epix Gen 2, Venu 3S, FR265). My app makes web requests to a third party server, and the response is relatively large, too large for the FR745 to process it in the glance. So I need to implement the glance differently and only show static information.

How could I implement such different behavior. Is there a way to check in the code how much memory is available? Or have code execute only for certain device types? Only way I could think of right now is to have a property in the device-specific resource folder, that tells me I should do something different. Is that the way, or is there something better?

Regards, Robert

  • No, but yes:)

    If you have:

    log("bla bla: " + foo);

    And:

    (:release, :inline) function log(s) {}

    Then after inlining the empty block the second phase also eliminates the data ("bla bla: " string) and the string concatenation, because it knows that the concatenation doesn't change the state of the caller class, and the result isn't used.