Skip to content

Instantly share code, notes, and snippets.

@fbukevin fbukevin/
Last active Dec 28, 2016

What would you like to do?
Load general text file in Android
public String loadText(Context cxt, String file){
String text = "";
InputStream is = cxt.getAssets().open(file);
int size = is.available();
byte[] buffer = new byte[size];;
text = new String(buffer, "UTF-8");
} catch(IOException ex){
return text;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.