Loading File from SD Card

Put your problem here if it does not fit any of the other categories.

Loading File from SD Card

Postby iifuzz » Thu May 21, 2009 6:05 pm

Could someone please provide a code snippet for reading a text file from the SD Card?

Also, if possible, loading a kml file into a currently open mapview.


The file im trying to work with is:

/sdcard/Projects/Test.txt

i have tried this but i get a File Not Found error


FileInputStream fIn = new FileInputStream("/sdcard/Projects/Test.txt");
DataInputStream myInput = new DataInputStream(fIn);

while ((thisLine = myInput.readLine()) != null) {


}


I have my Android phone hooked up to my computer via USB and running the apk thru the phone. Not the emulator
iifuzz
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 21, 2009 6:00 pm

Top

Postby iifuzz » Thu May 21, 2009 6:31 pm

Found the problem with reading the file was that i was mounted to it with the pc....

Still would like to know if its possible to read in a kml file tho :)
iifuzz
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu May 21, 2009 6:00 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 34 guests