Android - Metawear - MbientLab - 无法下载记录的数据

Android - Metawear - MbientLab - Unable to download Logged Data

我想将数据存储到设备内存中,并在以后需要时检索数据。 我遵循了数据记录的文档。 我能够成功记录数据,但是当我使用 downloadAsync 方法时,它只告诉我已下载的条目数和剩余条目数的进度,但它没有给我数据。它还告诉我数据已下载。但是我没有得到数据。

有一些讨论,但这对我帮助不大。
https://mbientlab.com/community/discussion/2110/trouble-logging-data

下面是日志记录文档link
https://mbientlab.com/androiddocs/latest/logging.html

// download log data and send 100 progress updates during the download
logging.downloadAsync(100, new Logging.LogDownloadUpdateHandler() {
    @Override
    public void receivedUpdate(long nEntriesLeft, long totalEntries) {
        Log.i("MainActivity", "Progress Update = " + nEntriesLeft + "/" + totalEntries);
    }
}).continueWithTask(new Continuation<Void, Task<Void>>() {
    @Override
    public Task<Void> then(Task<Void> task) throws Exception {
        Log.i("MainActivity", "Download completed");
        return null;
    }
});

在上面的代码片段中,我如何获取下载的记录数据。

处处磕磕绊绊终于找到了解决办法,

上面的代码片段下载日志,但实际上你必须像流式传输时一样记录日志。下面是完整代码

 private Logging acceleroLogging;
 private void setupAccLogging() {
    accelerometer = board.getModule(Accelerometer.class);
    acceleroLogging = board.getModule(Logging.class);
    accelerometer.configure()
            .odr(50f)
            .range(8f)
            .commit();
    accelerometer.acceleration().addRouteAsync(source -> source.log((data, env) -> {
        Acceleration value = data.value(Acceleration.class);
        Log.d("LoggingAccelero", value.x() + "::" + value.y() + "::" + value.z());
    })).continueWith(task -> {
        acceleroLogging.start(true);
        accelerometer.acceleration().start();
        accelerometer.start();
        return null;
    });
}

对于日志:

 acceleroLogging.stop();
            acceleroLogging.downloadAsync(100, (nEntriesLeft, totalEntries) ->
                    Log.i("Logging@", "Progress Update = " + nEntriesLeft + "/" + totalEntries)).continueWith((Continuation<Void, Void>) task -> {
                if (task.isFaulted()) {
                    Log.e("Logging", "Error occured");
                } else {
                    Log.i("Logging", "Downloaded");
                }
                return null;
            });

哇太棒了,我真的想做同样的事情但是为了欧拉的角度,但我没能做到,你能上传完整的代码以与欧拉一起使用吗?