[android-developers] Re: Problem reading file

2009-02-12 Thread David
I found the problem. An InputStreamReader will not read() to a String.toCharArray(). You have to use a char[]. Here is my new function for reference: public String loadFile(String filename) { try { FileInputStream fis =

[android-developers] Re: Problem reading file

2009-02-12 Thread Michael MacDonald
Actually, it can read fine to toCharArray, since that just returns a char array. However, since you were basing it off an empty string, the array length was 0, and so it wasn't reading any bytes :) David wrote: I found the problem. An InputStreamReader will not read() to a

[android-developers] Re: Problem reading file

2009-02-11 Thread Mark Murphy
David wrote: Hey guys, I need some help with reading the contents of a file. I have a plaintext file called 'test' in my app's files/ directory. I have this code to read it: public String loadFile(String filename) { try {

[android-developers] Re: Problem reading file

2009-02-11 Thread Mark Murphy
David wrote: Hey guys, I need some help with reading the contents of a file. I have a plaintext file called 'test' in my app's files/ directory. I have this code to read it: public String loadFile(String filename) { try {

[android-developers] Re: Problem reading file

2009-02-11 Thread David
Unfortunately, that didn't solve my problem. Any other help? P.S. I tried that tutorial in normal java and it worked, but not in android. On Feb 11, 5:51 pm, Mark Murphy mmur...@commonsware.com wrote: David wrote: Hey guys, I need some help with reading the contents of a file. I have a