I haven’t figured out a clever way of saving files to the phone’s file system using Thunkable but I did manage to configure it to send the comma separated values in the form of the body of an email.
At some point I want to try replicating this in Thunkable using the open-ended functions or by simply editing the exported APK in android studio and adding this:
AHEM, MAYBE THUNKABLE FOLK ADD A MODULE FOR US INSTEAD… HINT HINT.
String baseDir = android.os.Environment.getExternalStorageDirectory().getAbsolutePath();
String fileName = "AnalysisData.csv";
String filePath = baseDir + File.separator + fileName;
File f = new File(filePath);
CSVWriter writer;
// File exist
if(f.exists()&&!f.isDirectory())
{
mFileWriter = new FileWriter(filePath, true);
writer = new CSVWriter(mFileWriter);
}
else
{
writer = new CSVWriter(new FileWriter(filePath));
}
String[] data = {"Ship Name", "Scientist Name", "...", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").formatter.format(date)});
writer.writeNext(data);
writer.close();