'Why can only certain compiler apps write to internal storage?

I'm programming in Java on my Samsung Galaxy S9+, and my program creates and writes to files. When I run the code in the app Online Compiler, it successfully writes to the files, but when I run it in other compiler apps such as Dcoder or Java N-IDE, it returns errors saying "Read-only file system" or "Permission denied".

I would be alright with just using Online Compiler if it weren't for the fact that Online Compiler asks for all runtime inputs upfront, which doesn't allow for more than one set of inputs. My program requires that functionality because it allows the user to choose a method which then takes input.

I'm asking this question in hopes that the answer may lead me to a way to make Dcoder or Java N-IDE get the same permissions as Online Compiler. If that's not possible, then I'd be grateful if someone could recommend an Android compiler app that has both write permissions and multiple input functionality.

As a side note, in my research, I found a lot of questions talking about Android app developing and using a .xml Android manifest file to request permissions. That sounds like it's talking about developing sellable apps for the Android platform, which isn't what I'm doing. I'm just writing a simple Java program for myself that needs to write to files. I may share this program with a friend to use on their phone at some point, but that's the furthest I plan to take it.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source