I have the following code, but I need to allow the user to choose where they want the .csv file saved.
public void ExportData()
{
Init();
TableQuery<Record> Records = conn.Table<Record>();
List<Record> records = Records.ToList();
string csvFilePath = System.IO.Path.Combine(FileSystem.AppDataDirectory, "export.csv");
using (StreamWriter writer = new StreamWriter(csvFilePath))
{
// Write the column headers to the CSV file
// writer.WriteLine("Id,Amount,Paid,PurchaseDate");
// Loop through the list of records and write each record to the CSV file
foreach (Record record in Records)
{
writer.WriteLine("{0},{1},{2}", record.Amount, record.Paid, record.PurchaseDate);
}
}
conn.Close();
}
Anyone know how to do that?
EDIT:
The solutions provided in the comments below seem to be Windows and MacOS based. I am looking for an Android based solution.