Background operation on tizen/javascript - watchface hourly alarm

402 views Asked by At

I am trying to add an hourly alarm to my watchface on Samsung Gear 2 (tizen/javascript) 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);

}

Also, I would like to add a vibration. Where can I find info about tizen vibration procedures ?

1

There are 1 answers

0
yasin tavukcuoglu On

ok. I found the solution. Instead of putting the window.requestAnimationFrame(watch) function to an interval, I created another function and put the animation frame request in it.