I am building an app with API level 19 and I am using:
// download the file
input = connection.getInputStream();
fOut = openFileOutput("example.json",MODE_WORLD_READABLE);
it says that "The field Context.MODE_WORLD_READABLE is deprecated", is there some alternative or adding the @SuppressWarning there is not problems to use it? Thank you
Making files world-readable can be a security flaw, which is why Google no longer endorses the practice. In particular, I cannot think of a reason why a JSON file would need to be world-readable.
If you want an app to make file content available to other apps, use FileProvider
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With