Neamar / KISS

Lightning fast, open-source, < 250kb Android launcher
https://kisslauncher.com/
GNU General Public License v3.0
2.98k stars 582 forks source link

Cache app list betwen restarts #1050

Closed ismail-s closed 6 months ago

ismail-s commented 6 years ago

I have started to use KISS as an assistant app. For some reason, this means that often, KISS gets restarted. On restart, there is a lag of a few seconds whilst the list of installed apps are retrieved. Could we not provide an option to cache the list of installed apps, with the caveat that uninstalled apps would appear for a few seconds in the search results

cdysthe commented 6 years ago

This would be a great improvement especially on lower powered phones which Kiss will often run on.

Neamar commented 6 years ago

A couple years ago, we thought about caching everything in a local DB.

This never made it to prod for two reasons:

  1. we decided instead to focus on the time to retrieve the app list
  2. there were concerns that the algorithm we used to "score" results can't be expressed as an SQL query

Today, I'd say that 2. is a very good argument against this. I hope 1 can be improved... but if we can't, then maybe storing everything locally and reusing could be a solution.

TBog commented 5 years ago

Why do we need the algorithm we used to "score" results to be expressed as an SQL query?

Mikaela commented 5 years ago

I was just going to report a duplicate about this.

KISS often goes to "Start searching for anything" after opening a few apps and then closing all apps

If I open a few random apps, like Telegram, Lightning (web browser), some third app and start chatting, switching between apps and finally clear all recent apps, KISS goes back to the "Start searching for anything" screen and I have to wait for around 30 seconds for KISS to become usable again (favourites reappear, I see the history and can search for apps).

At first I thought this was caused by having many contacts, but after disabling the contacts provider, nothing changed.

there were concerns that the algorithm we used to "score" results can't be expressed as an SQL query

I am not a coder and don't know how it works, but if by scoring you mean frequently used, could KISS request usage access and that way know how often apps have been used even before it was installed?

TBog commented 5 years ago

I have the same problem but in my case it takes only 5 seconds for the search to work again. It was just a nuisance for me but 30 sec is a long time for you. I will try to make a fix for this next week.

licaon-kter commented 5 years ago

@Mikaela don't juggle that many apps on 1Gb of RAM, as Android might decide to purge apps/cache from memory and that might be the issue that you see.

Mikaela commented 5 years ago

After finding the beta (https://github.com/Neamar/KISS/issues/1145) I see that 3.7.5 is a lot faster loading the items, I don't know why or if it's just a happenstance and it's also going to slow down.

don't juggle that many apps

It's not always my choice and I cannot be cleaning recently used apps all the time :(

licaon-kter commented 5 years ago

@Mikaela I understand, just pointing out that no matter how good is KISS there's always at the mercy of the OEMs kill settings.

Mikaela commented 5 years ago

Oh, I am aware of that and have done what I could by removing com.enwell.emm as per https://dontkillmyapp.com/ as Nokia is the worst carreir in that recard. Good night

Neamar commented 5 years ago

(a quick note: there is definitely room for improvement here, but a quick win is to make kiss your default launcher as it will then be less likely to be killed by the system)

Mikaela commented 5 years ago

This is happening with KISS as my default launcher.

Mikaela commented 5 years ago

I counted around 77 seconds while bouncing around Telegram, Lightning, Conversations and Google Photos now on 3.7.5 so maybe updating it doesn't clear the cache.

nmitsou commented 5 years ago

I had a similar issue on a Samsung device with 1gb ram. My workaround was to install a custom rom. It made the phone usable again. However caching favorites, history and allowing them during kiss start would be really nice

TBog commented 5 years ago

Please test that my PR works for phones with multiple users or work profile

Mikaela commented 5 years ago

My phone doesn't support multiple users or work profile that I can see, but I would be interested in testing anyway in hope it fixes my problem. However I don't know how do I test it and would that cause me to lose all custom tags?

TBog commented 5 years ago

You can make a backup using adb backup -f kiss.ab fr.neamar.kiss

Mikaela commented 5 years ago

Ok, and how do I build/install it?

licaon-kter commented 5 years ago

@TBog better provide an APK with a different ID since you can build anyway ;)

TBog commented 5 years ago

If you trust me then try this apk. It contains the tag favorites PR and the app list cache PR

TBog commented 5 years ago

The issue I have now is that the kiss button is not working when it's loading and because of this I can't access the favourites

github-actions[bot] commented 6 months ago

This issue has been closed automatically. Please see https://github.com/Neamar/KISS/issues/1688 for details. Thank you for your contributions.