Languages

Menu
Sites
Language
Sensors - Periodically checking

What is the best way to do a periodically check on sensors such as UV or light and notify the user if those values riches a limit set by me? I would like this task to run somewhere in background, that do not require any user interaction.

I have already tried Alarm API, but this method opens my entire application, including the UI and I don't want that behaviour. I would like to perform this task in background, similar to a service.

If you could give me any suggestions I would appreciate it very much!

 

Thanks,

Bogdan

 

Responses

3 Replies
Vikram

Hello,

How about to use the setInterval() to check your sensor periodically ?

You can find some example in this link.

 http://www.w3schools.com/jsref/met_win_setinterval.asp

Hope this help.

 

Bogdan Baran

Hello,

I tried this method too, but it's drawback is that the app need to run always in the background and this will be not good for battery. Also this method does not work if you close the app, exit, not hide (from background also). This method required the app to be in running model allways.

I tried to use Service Application, but this feature is only for Tizen 2.3 version and my Gear S has 2.2.1.4.

 

Does anyone know if there will be any firmware release soon for Gear S?

 

Thanks,

Bogdan

AVSukhov

Hello,

Сurrently it is not possible on wearable profile. I hope the next version of SDK this functionality will be added.

Follow for updates on developer.tizen.org