Monday, November 21, 2011

GET TEXT FROM ASSERT ANDROID



private String getAssertText(String path) {
String javascrips="";
try {
InputStream input = getAssets().open(path);
int size;
size = input.available();
byte[] buffer = new byte[size];
input.read(buffer);
input.close();
// byte buffer into a string
javascrips = new String(buffer);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return javascrips;
}

No comments:

Post a Comment

content -->