Java tutorial
//package com.java2s; import android.os.Environment; import java.io.File; import java.io.IOException; public class Main { public static void createCSV() { File folder = new File(Environment.getExternalStorageDirectory() + "/adspammer"); if (!folder.exists()) folder.mkdir(); String filename = folder.toString() + "/" + "log.csv"; File csvFile = new File(filename); if (!csvFile.exists()) try { csvFile.createNewFile(); } catch (IOException e) { e.printStackTrace(); } } }