How can I read a file from Assets a file dir which is made by me in Android application?
2 Answers
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) { } 2 Comments
LightPoint
Thanks a lot ,this i can do it ,but while i create a file dir and put one file in it ,i can not read this file .
droid kid
You can do like this InputStream in = getAssets().open("YourFolder/EULA.txt");
try using like this
InputStream myInput = this.getAssets().open("your_dir/yourfilename"); 2 Comments
LightPoint
let me have a try ,Thanks a lot
ilango j
if it is solved your problem then accept the answer, then only others will use this answer.