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 ..