TeamAmaze / AmazeFileUtilities

An open source Google Files alternative for Android
https://teamamaze.xyz
GNU General Public License v3.0
316 stars 28 forks source link

Analysis to show list of apps that are growing in size #139

Closed VishalNehra closed 8 months ago

VishalNehra commented 9 months ago

Analysis to show list of apps that are growing in size and by how much in a configurable amount of time. For eg. let's say default configuration is last 7 days, so analysis to show in descending order, list of apps that is grown in last 7 days.

seelchen commented 9 months ago

Hi, I would like to work on this.

I have looked into it a little bit and found the findApplicationInfoSize function to get an app's current size which I would use for this feature.

To calculate the growth in an amount of time, the size for all apps would probably need to be queried every day and stored in the database. I would use a PeriodicWorkRequest for that to get the sizes at the start of a day and store them in the database. When the user opens "Analyse", the current size would be queried and compared to the size x days prior.

Do you see any issues with this approach?

VishalNehra commented 9 months ago

@seelchen Sounds good! Few points:

  1. How sure are we that periodic work request schedule will run everyday and not get killed. There need to be a fallback at app startup, if today's data isn't fetched then manually run it again and save to db.
  2. If for some day the schedule didn't get executed (got killed) and user also didn't open the app, we need to have default values for apps usage (maybe -1), not mention, exclude this negative value when calculating data growth.
  3. Let's say user has selected to check growth in last 7 days (btw no. Of days to check growth should be configurable from settings), and 7 days before today we have -1, then we'll need to decide what to do, maybe exclude showing this analysis at all, next day when user opens it's possible we'll be able to show analysis again, or another option is to look for ±1 day where there isn't a -1.

Initial plan looks good, let me know if you need help with something 🙂