hello
I’m trying to read a random line from a file , my method works on Desktop but not Android :
{
// Read in the file into a list of strings
BufferedReader reader = new BufferedReader(new FileReader("bin/data/file.txt"));
List<String> lines = new ArrayList<String>();
String line = reader.readLine();
while( line != null ) {
lines.add(line);
line = reader.readLine();
}
// Choose a random one from the list
Random r = new Random();
randomString = lines.get(r.nextInt(lines.size()));
}
any idea how to convert this code to work with LibGdx FileHandle ?