语言

Menu
Sites
Language
How to recognize "WRIST_UP" gesture?

Hi All,

I am trying to catch "WRIST_UP" on GEAR S2, but it could not enter Success callback or Error callback.

I am not sure if I missed some codes, but I have got "pedometer" and "heart rate" data successfully using the same way.

In Tizen developer, it is suggested that add "<feature name="http://tizen.org/feature/sensor.wrist_up"/>" into config.xml, and it has no effect for me.

Anyone knows how to deal with it? Thanks in advance.

 

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/Smart" version="2.3.1" viewmodes="maximized">
    <tizen:application id="1RFUTfsPl5.Smart" package="1RFUTfsPl5" required_version="2.3.1"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>  
    <feature name="http://tizen.org/feature/sensor.wrist_up"/>
    <feature name="http://tizen.org/feature/sensor.heart_rate_monitor"/>
    <icon src="icon.png"/>
    <name>Smart</name>
    <tizen:privilege name="http://tizen.org/privilege/alarm"/>
    <tizen:privilege name="http://tizen.org/privilege/bluetooth.admin"/>
    <tizen:privilege name="http://tizen.org/privilege/bluetooth.gap"/>
    <tizen:privilege name="http://tizen.org/privilege/bluetooth.spp"/>
    <tizen:privilege name="http://tizen.org/privilege/bluetooth.health"/>
    <tizen:privilege name="http://tizen.org/privilege/mediacapture"/>
    <tizen:privilege name="http://tizen.org/privilege/healthinfo"/>
    <tizen:setting background-support="enable" />   
    <tizen:profile name="wearable"/>
</widget>

/*Wrist up*/
function onchangedWristCB()
{   
   wristUPCnt++;
   console.log("You are looking at your smartwatch:"+ wristUPCnt);
}

function onErrorWristCB()  
{   

   console.log("Error occurs. name:");
}

tizen.humanactivitymonitor.start("WRIST_UP", onchangedWristCB, onErrorWristCB );

 

查看选择的答案

响应

6 回复
Marco Buettner
Remark : When the CPU is in the power saving mode, WRIST_UP event might not occur even though <tizen:setting background-support="enable" /> is declared in config.xml file. 

 

Pang

I noticed this reminder, and I am sure it is not in power saving mode.

Marco Buettner
Pang

anyone knows how to resolve this problem?  it is in normal mode instead of power saving mode.   I added log prior to the "start", and the log could be printed, however, there is no sign that "start(WRIST_UP)" has been executed.

I tried this in two GEAR S2. Stangely, I can get data of pedometer and heart rate. 

Mark as answer
AVSukhov

hello,

try to check WRIST_UP supported using tizen.systeminfo.getCapability()

with key: http://tizen.org/feature/sensor.wrist_up

Pang

hello,

yes, you are right. I updated Tizen firmware of the smart watch, and it could catch wrist_up action, without any code change.

Thanks for your method.