0

I have several JSON files programmatically saved using the Android Application I just created. I just wonder if the JSON files will be deleted physically after I uninstall my app. Does anybody have any idea? I would greatly appreciate if there is.

Kim Honoridez
  • 917
  • 2
  • 15
  • 28
  • 1
    Look at [this answer](http://stackoverflow.com/questions/1222269/how-to-delete-files-created-by-the-application-on-uninstall) basically the type of the file does not matter, only the paths where you are putting them do. – Flavien Volken Dec 23 '13 at 13:24

3 Answers3

1

If you save file in your application CacheDir then it is automatically detect when you uninstall the application.

So, save file in sdcard folder without CacheDir folder.

Thanks

Md Abdul Gafur
  • 6,213
  • 2
  • 27
  • 37
1

I just wonder if the JSON files will be deleted physically after I uninstall my app.

If they are stored on internal storage, or in getExternalFilesDir(), or in getExternalCacheDir(), they will be removed on an uninstall.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
1

It depends on where you saved your JSON file, but it will be deleted if you save it to Internal Storage:

From the docs:

  • It's always available.
  • Files saved here are accessible by only your app by default.
  • When the user uninstalls your app, the system removes all your app's files from internal storage.

See here.

Melquiades
  • 8,496
  • 1
  • 31
  • 46