Android 8 "clear data" doesn't delete data?

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Posts: 105
Joined: Sat Apr 15, 2006 7:20 am

Android 8 "clear data" doesn't delete data?

Post by pkocsis » Thu Mar 21, 2019 10:23 pm

I have a user with android 8.0.0. I have him go to settings, apps, and find my app and tap storage. I have him tap "clear cache", then tap "clear data". Then I have him uninstall my app. I then send him a new version of my app to install. After installing, the old data from the previous app is still there. I know there is no LC android function to tell android to *not* backup this app's data, but I would think that "clear data" in settings for the app should delete all created files by the app. I don't even know if its an "android backup" thing or not, but can anyone shed any light on what the heck is going on here?


EDIT: I'm putting files in subfolders under specialFolderPath("documents") I am creating subfolders under that path. Pre-Android 8, "clear data" would delete all data including subfolders. Possibly Android 8 does not delete created subfolders under the app's documents folder?

2nd EDIT: It would appear that on Android 8, one *must* tap "Force Stop" (even if the app has been swiped away in the running/recent list) before "clear data" in order for the data to *actually* be deleted. Of the few actual devices I have available to me, "clear data" on Android 6 does delete files even if "force stop" was not tapped first, whereas Android 8 does not (unless force stop" is tapped first). That's my latest findings/theory purely by trial and error with 2 devices and I have no way of knowing whether this is all Android devices >= 8 or not...

3rd EDIT: So another issue (which, in fact, *could* be "the whole issue here") is that there is an android setting (on all? what version of android? I don't know as it is not on my android 7.1 device). This setting, if checked, tells android to "restore data files (from backup/cloud) to an app that I install that was previously installed and used on this device" ....or something along those lines. effect, if someone has that setting checked, I don't see a way to NOT start with previous/old data files for my app if the user deletes the app and then re-installs it. Does anyone know if there is a way to (systematically) prevent this if I don't want that to happen? ....or do I have to roll my own and keep a "data files version" so that I can write into my app whether to carry on with the "old" data or wipe it out and start fresh?

Post Reply

Return to “Android Deployment”