Click here to Skip to main content
15,997,776 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have generated csv file with their field names and then i have to write the sqlite database values into that... I have tried a lot..Please let me understand..

void generateCsvFile(String sFileName) {
try
{
File root = Environment.getExternalStorageDirectory();
File gpxfile = new File(root, sFileName);
FileWriter writer = new FileWriter(gpxfile, true);
abc="contacts";
writer.append("lat");
writer.append(',');
writer.append("lon");
writer.append(',');
writer.append("heading");
writer.append(',');
writer.append("time");
writer.append(',');
writer.append("imeinumber");
writer.append(',');
writer.append("speed");
writer.append(',');
writer.append("distance");
writer.append(',');
writer.append("vehicle");
writer.append(',');
writer.append("start");
writer.append(',');
writer.append("end");
writer.append('\n');
db.query(DATABASE_TABLE, gpxfile);

writer.flush();
writer.close();

}



catch(IOException e)
{
e.printStackTrace();
}
}


After that how to proceed ..
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900