根据Google Fit SDK示例,我在一周内查询会话,但它仅返回由我的应用创建的信息。
private SessionReadRequest readFitnessSession() {
Calendar cal = Calendar.getInstance();
Date now = new Date();
cal.setTime(now);
long endTime = cal.getTimeInMillis();
cal.add(Calendar.WEEK_OF_YEAR, -1);
long startTime = cal.getTimeInMillis();
// Build a session read request
SessionReadRequest readRequest = new SessionReadRequest.Builder()
.setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS)
.read(DataType.TYPE_SPEED)
.setSessionName(SAMPLE_SESSION_NAME)
.build();
// [END build_read_session_request]
return readRequest;
}
如何在一段时间内完成所有活动?我需要构建一个发布应用程序吗?
当用户在Google健身中添加活动时,是否有任何事件监听器或意图?