String [] fileList = getAssets().list("textImages");
Note, textImages is a folder under Assets.
for (int i = 0; i < fileList.length; i++) {
InputStream is = getAssets().open("textImages/"+fileList[i]);
                        }
Thanks,
Ankur.

On Thu, Dec 30, 2010 at 10:09 PM, Stephan Wiesner <
[email protected]> wrote:

> Hi,
> I want to read a txt file that is deployed with my application.
> The file is in the assets directory and I try to read it with:
>
>  String url = "file:///android_asset/text.txt";
> InputStream instream = openFileInput(url);
>
> This results however in:
> 12-31 07:05:46.638: DEBUG/GMAP(14396): Read
> error:java.lang.IllegalArgumentException: File
> file:///android_asset/text.txt contains a path separator
>
> So, where should I put the file or how should I read it?
>
> Thanks,
> Stephan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to