如何在 android 应用程序中创建 .csv 文件,我们将在其中存储一些数据,例如一些员工详细信息?
最佳答案
从 here 下载库
并将 jar 文件添加到您的应用程序中。
在你的应用程序中做
CSVWriter writer = null;
try
{
writer = new CSVWriter(new FileWriter("/sdcard/myfile.csv"), ',');
String[] entries = "first#second#third".split("#"); // array of your values
writer.writeNext(entries);
writer.close();
}
catch (IOException e)
{
//error
}
关于android - 在 Android 应用程序中创建 .CSV 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9561749/