4
On the basis of that question by stackoverflow in the reply is suggested this code
try {
AssetManager assetManager = getResources().getAssets();
InputStream inputStream = assetManager.open("nome-do-arquivo.txt");
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
String linha;
LinkedList<String> linhas = new LinkedList<String>();
while((linha = bufferedReader.readLine())!=null){
//aqui com o valor da linha vc pode testar o que quiser, por exemplo: linha.equals("123")
linhas.add(linha);
}
inputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
The question is with more variables which command for it to jump aligns and stored the value in the variable inside the while
.
and the main question which folder should be arquivo txt
on Android?, because only the file name is passed.