Reputation: 1
How can I read a file from Assets a file dir which is made by me in Android application?
Upvotes: 0
Views: 259
Reputation: 6037
try using like this
InputStream myInput = this.getAssets().open("your_dir/yourfilename");
Upvotes: 1
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