Vote count:
0
I'm trying to read a file created by another Android application.
File file = new File("/data/data/air.br.com.screencorp.MobilePlayer/br.com.screencorp.MobilePlayer/Local Store/token");
FileInputStream fis = null;
try {
fis = new FileInputStream(file);
Log.d("SIZE", "Total file size to read (in bytes) : "
+ fis.available());
int content;
StringBuilder token = new StringBuilder();
while ((content = fis.read()) != -1) {
token.append((char) content);
}
Log.d("TOKEN", token.toString());
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (fis != null)
fis.close();
} catch (IOException ex) {
ex.printStackTrace();
}
}
I don't know why, but I'm not allowed to access that file. I have the READ_EXTERNAL_STORAGE
permission on my manifest.
Thanks.
asked 35 secs ago
EACCES (Permission denied). Trying to access a file created by another application Android
Aucun commentaire:
Enregistrer un commentaire