如何创建的.csv 在Android应用程序,在此我们会存储一些数据,如一些雇工的细节文件?
How can create .csv file in android application, in which we will store some data like some employe details?
下载库从这里
和JAR文件添加到您的应用程序。
and jar file add to your application.
在你的应用程序做
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
}