Happy Torturer Happy Torturer - 1 year ago 191
Android Question

openFileOutput() method vs FileOutputStream() constructor

Why in Android one should use

method instead of

Would the mode type as a second param of openFileOutput() be the only "respectful" reason for all the cases?

FileOutputStream fos;
fos = openFileOutput("test.txt", Context.MODE_PRIVATE);
fos = new FileOutputStream("test.txt");

Answer Source

Another difference is that openFileOutputStream opens / creates a file in the the device's "internal" storage.


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download