I have got three questions to ask regarding tizen sdk and Samsung gear 2. I am trying to write a file with the heart rate sensored from gear 2. My app heart rate sensoring beggining with the following command
window.webapis.motion.start("HRM", onchangedCB);
Firstly I want to find a way to correspondigly close the app when I press the main button of gear 2. I found default code to do so:
document.addEventListener('tizenhwkey', function(e) { if(e.keyName == "back") tizen.application.getCurrentApplication().exit(); window.webapis.motion.stop("HRM"); });
However this code is not seem to working. Moreover heart rate sensor device is not stopping after the start of the app. How can I close the hr device? Thirdly I wrote hr in a file. However it seems that javascript write function does not recognize new line character "\n". How can I add new line character in write function?