What saved in Android app "Data" under Storage?

663 views Asked by At

My app uses Fragments, SQLite Database, SharedPreferences and SavedInstanceState to keep the state. The problem is that the Data size does not stop increasing (about 100-300kB) on each Fragment launch. I can not count on Clear Data as long as it removes all data including SQLite Database of the application.

1- What are data of android application saved in Settings> Apps >App info> STORAGE> Data? OK (tnx to artworkad シ reply)

2- How this problem can be solved? (while SQLite database must be kept)

*****UPDATE**: After disabling every probable source of storage (database & Shared Preferences), I figured out that problem is due to AdView. It means once adview content is shown it adds some data to app storage, when I switch between Fragments/FragmentActivities.

Your help is really appreciated!

enter image description here

1

There are 1 answers

3
DarkLeafyGreen On

Data are application databases and shared preferences. Share preferences are a simple key/value store, you should not abuse it to persist big data sets.

If your sqlite databases grow, the data will take up more space on the phone.

How to solve the problem of growing data size?

You could keep some of this data on a sever and load it on demand. Or you can try compression, e.g. VACUUM.