Detect WRIST UP in Gear

This code shows how to detect the WRIST UP of human in Tizen Web App. It will not work in Emulator. It will work only in Gear.
//config.xml
 <tizen:privilege name="http://tizen.org/privilege/setting"/>
 <feature name="http://tizen.org/feature/sensor.wrist_up"/>
 <tizen:privilege name="http://tizen.org/privilege/healthinfo"/>

//index.html
 <div class="ui-page ui-page-active" id="main">
    <div class="ui-content">
	<span id="WristData"></span>
    </div>
 </div>

//main.js
tizen.humanactivitymonitor.start("WRIST_UP", onchangedCB);

// callback
function onchangedCB()
{
   document.getElementById("WristData").innerHTML = "You are looking at your smartwatch";
   console.log("You are looking at your smartwatch");
}

Responses

0 Replies