Speed up F-Droid startup

From F-Droid
Jump to: navigation, search

Note

This has been implemented using ContentProviders to lazily load the list of apps in the main views. ContentProviders are also used for all other database access too.

Problem

The app is taking longer and longer to initialize

Possible Solutions

Load app lists via CursorLoader

Prevent every application from being loaded at the start, rather lazily loading them using the CursorLoader. Issue #244 is tracking the progress of this.

I've (pserwylo) started work on this, and it seems to work well for the first list (i.e. all apps, or apps in a certain category). It also works with the other views, but the sql ends up being a little strange:

SELECT ... FROM fdroid_app WHERE appid IN ( [list of all installed apps, which can get quite long] )

but it seems to work nicely. I wonder if this type of query will become an issue if you have > 250 or 500 apps installed.