How can create .csv file in android application, in which we will store some data like some employe details?
download library from here
and jar file add to your application.
Inside your application do
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With