I'm trying to read a file, and I keep getting an error saying ENOENT(no such file or directory).
I made the .txt file on my computer, and then I wanted to use that. I've tried putting the file in many different places, the assets folder, in data/data/files and I keep getting the error. Can someone help me?
This is the code I have written.
try {
FileInputStream fis = openFileInput("permissions.txt");
DataInputStream dataIO = new DataInputStream(fis);
String strLine = null;
int i =0;
while((strLine = dataIO.readUTF()) != null){
i++;
String[] temp = strLine.split(":");
if(temp[0].contains("String")){
PermissionNames.names[i] = remove(temp[0]);
}
PermissionNames.descriptions[i] = temp[1];
}
dataIO.close();
fis.close();
}catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}