创建.csv文件中的Andr​​oid应用程序应用程序、文件、csv、oid

2023-09-04 13:19:15 作者:○o嘟嘟%飛

如何创建的.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
}
 
精彩推荐
图片推荐