首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不明白humanactivitymonitor.readRecorderData计步器的错误信息。

我不明白humanactivitymonitor.readRecorderData计步器的错误信息。
EN

Stack Overflow用户
提问于 2022-10-06 05:13:03
回答 1查看 76关注 0票数 0

TypeMismatchError:错误的人类活动记录器类型通过

这是我的代码:

代码语言:javascript
复制
if (tizen.systeminfo.getCapability('http://tizen.org/feature/sensor.pedometer') === false) {
    console.log('pedometer is not supported on this device.');
}
else {
    
    var query = {};
    query.startTime =(new Date(2022, 10, 5)).getTime() / 1000;
    query.endTime = (new Date(2022, 7, 31)).getTime() / 1000;
    query.anchorTime = (new Date(2022, 7, 31, 0, 0)).getTime() / 1000;
    query.interval = 1440; /* Day */
    
    console.log(JSON.stringify(query));
    
    tizen.humanactivitymonitor.readRecorderData('PEDOMETER', query, successCallback, errorCallback);
    
}

我总是获得以下错误消息:

TypeMismatchError:传递错误的人类活动记录器类型

我在config.xml声明:

代码语言:javascript
复制
<feature name="http://tizen.org/feature/screen.size.normal"/>
<feature name="tizen.org/feature/sensor.pedometer"/>

 <tizen:privilege name="http://tizen.org/privilege/location"/>
 <tizen:privilege name="http://tizen.org/privilege/healthinfo"/>
 <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
EN

回答 1

Stack Overflow用户

发布于 2022-10-11 06:26:50

查询中的endTime不能在startTime之前。当我在您的代码中只更改endTime时,它不会得到TypeMismatchError。

您可以知道链接下面的错误类型。

https://docs.tizen.org/application/web/api/6.5/device_api/wearable/tizen/humanactivitymonitor.html

WebAPIException

代码语言:javascript
复制
with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.

with error type UnknownError, if registering the success callback fails because of an unknown error.

with error type NotSupportedError, if the given type is not supported on a device or by this method.

with error type SecurityError, if the application does not have the privilege to use this function.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73968906

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档