LightPoint
LightPoint

Reputation: 1

How can we read a file from Assets a file dir which is made by me in Android application?

How can I read a file from Assets a file dir which is made by me in Android application?

Upvotes: 0

Views: 259

Answers (2)

ilango j
ilango j

Reputation: 6037

try using like this

InputStream myInput = this.getAssets().open("your_dir/yourfilename");   

Upvotes: 1

droid kid
droid kid

Reputation: 7609

Try this...

            try {

               InputStream in = getAssets().open("EULA.txt");

               if (in != null)
               {
                    in = getAssets().open("EULA.txt");
                    int siz = in.available();
                    byte[] buffer = new byte[siz];
                    in.read(buffer);
                    result = new String(buffer);
                    in.close();
                }

        } catch(Exception e)
        {
        }

Upvotes: 2

Related Questions