user3773828
user3773828

Reputation: 15

Android & internal storage memory

If my application makes a file & stores it in the internal memory of the application ie in the path <internal_storage>/data/data/<package>, if I uninstall the application will the file that I stored be removed from the location? Also while writing the file if I give any mode(world_readable, world_writable seems to have been deprecated) can any application like file manager see the file that I have created? I have done a lot of research on this topic which has not helped me significantly.

Upvotes: 0

Views: 75

Answers (1)

Tadej
Tadej

Reputation: 2921

If I uninstall the application will the file that I stored be removed from the location?

Yes.

Also while writing the file if I give any mode(world_readable, world_writable seems to have been deprecated) can any application like file manager see the file that I have created?

  • MODE_PRIVATE: the default mode, where the created file can only be accessed by the calling application (or all applications sharing the same user ID).

  • MODE_APPEND: for use with openFileOutput(String, int), if the file already exists then write data to the end of the existing file instead of erasing it.

  • MODE_WORLD_READABLE: allow all other applications to have read access to the created file.

  • MODE_WORLD_WRITEABLE: allow all other applications to have write access to the created file.

For the last two modes (which are both deprecated), the following should be taken into consideration:

Creating world-readable files is very dangerous, and likely to cause security holes in applications. It is strongly discouraged; instead, applications should use more formal mechanism for interactions such as ContentProvider, BroadcastReceiver, and Service. There are no guarantees that this access mode will remain on a file, such as when it goes through a backup and restore.

Upvotes: 1

Related Questions