Created
July 2, 2015 22:42
-
-
Save mtrung/6d25cbdf6fefe7633936 to your computer and use it in GitHub Desktop.
dumpDataset from Google Fit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void dumpDataset(DataSet dataSet) { | |
if (dataSet.isEmpty()) return; | |
SimpleDateFormat dateFormat = new SimpleDateFormat(); | |
for (DataPoint dp : dataSet.getDataPoints()) { | |
String s = String.format("Data point: %s -> %s %s", | |
dp.getDataType().getName(), | |
dateFormat.format(dp.getStartTime(TimeUnit.MILLISECONDS)), | |
dateFormat.format(dp.getEndTime(TimeUnit.MILLISECONDS))); | |
Log.i(TAG, s); | |
for(Field field : dp.getDataType().getFields()) { | |
Log.i(TAG, "\t" + field.getName() + " = " + dp.getValue(field)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment