안드로이드 Asset 폴더의 파일을 읽어오는 방법.
String asset_str= readText("test.txt");
private String readText(String file) throws IOException {
InputStream is = getAssets().open(file);
int size = is.available();
byte[] buffer = new byte[size];
is.read(buffer);
is.close();
String text = new String(buffer,"EUC-KR");
return text;
}
덧글
써 보겠습니다.
감사합니다.