samedi 25 avril 2015

Using the emulator, how can I find and view CSV files?


I have the IO needed for writing a CSV file, however I want to be able to open it.

So my two problems, locating the file

If I use:

private static void csvFile(String sFileName) {

try
{
    FileWriter writer = new FileWriter(sFileName);

    writer.append("DisplayName");
    writer.append(",");
    writer.append("Age");
    writer.append('\n');
}
catch (IOException e)
{
    e.printStackTrace();
}

Then in my main class

csvFile("SPREADSHEET.csv");

Where would it save on the emulator since I didnt give it a directory? How could I find this file and open it on an emulator to ensure that it was doing things correctly? The emulator doesn't have capability to open such files unless I read it from java.


Aucun commentaire:

Enregistrer un commentaire