4

This is something new for me and after searching for a while unsuccessfully online, I am posting this question here.

I have bought a new Nexus 6P device with Android Marshmallow. I have noticed that when I install an app, and delete it, and then reinstall it, it still has its old data. Over last many days the devices's internal storage has accumulated over 30MB of data, and I am not able to delete this 30MB. The app itself is hardly 3MB.

I tried CLEAR DATA, and CLEAR CACHE, delete and reinstall the app, but this 30MB is not going away. I don't see any way to completely delete my app's data, as I was able to on any other phone or tablet before.

I don't know if this is a bug or a new feature on new Android devices, but I want to get rid of all the old data, otherwise I can't test my app on this phone with its stale data, which it keep coming back.

A screenshot is attached.

enter image description here

dur
  • 15,689
  • 25
  • 79
  • 125
zeeshan
  • 4,913
  • 1
  • 49
  • 58

3 Answers3

7

I had the same issue. Just uncheck "Back up my data" in the settings under Backup & Reset.

enter image description here

Martin Pfeffer
  • 12,471
  • 9
  • 59
  • 68
  • Thanks, this finally solved my problem. Now its not restoring from the backup, but in the Storage it still shows 30MB used. Where is this 30MB coming from. My app is only 2.5MB with hardy 500K data. – zeeshan Feb 17 '16 at 17:22
  • I guess it's 2.5MB when compressed into an apk. It might be 30MB when decompressed and installed. That's the only reason that comes to mind – Yair Kukielka Jan 06 '17 at 18:51
3

When you delete an app, the data is deleted. The feature you are seeing is that Marshmallow automatically backs up data to your Google account and restores it when the app is reinstalled. There may be an option to disable this feature. If all else fails, you can delete the data from the app itself. I also suggest a google search for something like "delete google cloud backup".

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • This is new for me. I could not find where on Google Drive it is storing it, but I can confirm that it does delete it locally when I do CLEAR DATA. I'll have to explore this Google Drive connection further. – zeeshan Feb 15 '16 at 02:55
  • @zeeshan It is not stored on Google Drive. If you do a google search, you should be able to find directions to accessing the data. – Code-Apprentice Feb 15 '16 at 02:58
  • Is this a developer-enabled option I can turn off somewhere? (I've had this issue with my Realm file persisting across app uninstalls) – Adam S Feb 15 '16 at 02:59
  • @zeeshan try googling "android deleting backup data from google cloud" – Code-Apprentice Feb 15 '16 at 03:01
  • @zeeshan everytime you can't enable/disable this option because it may affect some another apps backup functionality,so try using belowed solution. – Akshay Tilekar Nov 10 '16 at 05:17
  • Actually, the data is backed up by default to your Google account. Marshmallow is that it syncs everything when the phone is idle and charging (while you sleep). The problem with Marshmallow is that when you uninstall an app, it's not really uninstalled until the phone syncs with your google account (when you go to sleep). Due to this, if you uninstall and immediately install you will get the same app, even with the old internal data. This is a big behavior difference that Google didn't publicly advertise. To turn this behavior off, check the accepted response (Martin's) – Yair Kukielka Jan 06 '17 at 01:07
  • @YairKukielka If you delete an app and wait for several days and then reinstall, will the original data be restored? – Code-Apprentice Jan 06 '17 at 02:03
  • @Code-Apprentice In theory, if you have "Back up my data" on in Settings it should restore some of the original data. For details, check this: https://developer.android.com/guide/topics/data/autobackup.html – Yair Kukielka Jan 06 '17 at 18:45
2

Apps that target Android 6.0 (API level 23) or higher automatically participate in Auto Backup. This is because the android:allowBackup attribute, which enables/disables backup, defaults to true if omitted. To avoid confusion, we recommend you explicitly set the attribute in the <application> element of your AndroidManifest.xml. For example:

<application ...
    android:allowBackup="true">
</app>

To disable Auto Backup, add either of the following attributes to the application element in your manifest file:

  1. set android:allowBackup to false.

This completely disables data backup. You may want to disable backups when your app can recreate its state through some other mechanism or when your app deals with sensitive information that should not be backed up.

  1. set android:allowBackup to true and android:fullBackupOnly to false.

With these settings, your app always participates in Key/Value Backup, even when running on devices that support Auto Backup.

you can find more details here : https://developer.android.com/guide/topics/data/autobackup.html

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
Akshay Tilekar
  • 1,910
  • 2
  • 12
  • 22