Recently I found out that Android 6.0, Marshmallow, introduced Auto Backup system for application data.
It runs in the background, and from time to time backs up application data to your Google account. It is important to mention that these data doesn’t count as storage space, so no need to worry about that. Auto Backup can be disabled, but mostly the users are not aware that it even exists. This can, potentially, cause a security risk. For example, someone installs a Twitter app, and removes it from the phone, thinking it deleted all the data related to login. But then someone could install it back again and get access to the account because backup will restore everything back as it was before uninstalling.
From the developers side of view, we can resolve this by adding:
in Android Manifest.xml file, inside of <application> tag.
The above solution, does the job, but it is not so elegant solution.
Instead you should consider using Auto Backup feature to your advantage.
Start by checking out https://developer.android.com/guide/topics/data/autobackup.html here you will learn how to define what can and what do not need to be backed up.
If you have any suggestions, please leave a comment below.