Background operation on a watchface

Background operation on a watchface

BY 23 Nov 2014 Web Application Development

Hi,

I am trying to add an hourly alarm to my watchface.

But when the screen is off,     animation frame stops.

So I can not check when minute is 0 and make the sound.

How can I set a timer to run in background ? Or another method to trigger a sound when minutes is 0.

In onload fuction I have this:

window.requestAnimationFrame = window.requestAnimationFrame       || 
            window.webkitRequestAnimationFrame || 
            window.mozRequestAnimationFrame    || 
            window.oRequestAnimationFrame      || 
            window.msRequestAnimationFrame     || 
            function(/* function */ callback){
                window.setTimeout(callback, 1000 / 60 );
            };

   window.onload = function() {

    window.addEventListener('tizenhwkey', function(e) {
        if(e.keyName == "back")
            tizen.application.getCurrentApplication().exit();
    });

   window.requestAnimationFrame(watch);

}

 

Written by