Android Utililty Methods Text File Read

List of utility methods to do Text File Read

Description

The list of methods to do Text File Read are organized into topic(s).

Method

StringreadFromFile(Context context, String fileName)
read From File
InputStream is = null;
StringBuilder sb = new StringBuilder();
File file;
if (fileName == null || fileName.equals("")) {
    return null;
try {
    file = context.getFileStreamPath(fileName);
...
StringloadTextFile(Context context, String textFile)
load Text File
AssetManager assetManager = context.getAssets();
InputStream inputStream = assetManager.open(textFile);
BufferedReader bufferedReader = new BufferedReader(
        new InputStreamReader(inputStream));
StringBuilder stringBuilder = new StringBuilder();
String line = bufferedReader.readLine();
stringBuilder.append(line);
while (true) {
...