Reading File from Assets Folder
AssetManager assetManager = getApplicationContext().getAssets();
InputStream is = assetManager .open("filename.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
String dataString = sb.toString();
Comments
Post a Comment