Downloading data to phone
Hi, I'm new to android development. I want to ask after logging the data to onboard flash memory, how to download and save them to my mobile phone?
I tried to use the code provided in documentation.
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>() {
@Override
public Task then(Task task) throws Exception {
Log.i("MainActivity", "Download completed");
return null;
}
});
But where does the data go and how could I save them on my mobile phone?
This discussion has been closed.
Comments
This is explained in the documentation:
https://mbientlab.com/androiddocs/latest/data_route.html#handling-data
And in the tutorials:
https://mbientlab.com/tutorials/SDKs.html#on-board-logging
Hello, I've done the same thing. It will show the data store in flash memory on logcat in android studio. But I wonder how to save the data in an variable so that I can save them on my phone.
And it tell me downloading is continuning but I didn't see any of the data on it.
PS:here is the part to logging:
And here is the code to download:
mAcc.acceleration().stop();
mAcc.stop();
m_logging.stop();
m_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>() {
@Override
public Task then(Task task) throws Exception {
Log.i("MainActivity", "Download completed");
return null;
}
});
If you aren't at least seeing the sensor data in Logcat, then you probably are not running the code correctly. Use the variant downloadAsync method with the error handler and post any messages being forwarded to the handler.