I created a quiz app that involves reading about 20,000 documents from Firebase (with other fields inside) where there are names that need to be searched through a search bar in various activities of the app. I tried to create a main activity (which is executed as soon as the app starts) that would allow me to load and save all these documents in the device’s cache the first time, so that subsequently it would not have to reload all these documents from scratch. Doing this with about 3,000 documents worked, but now the app can no longer handle it and crashes because the cache memory capacity is not sufficient.
This is the activity I tried to implement, I also tried to set a limit of 20,000 documents, but it still doesn’t work.
https://gist.github.com/quizballinfo/38d5f7a25d2d1256b65da7088ee1460b
https://gist.github.com/quizballinfo/38d5f7a25d2d1256b65da7088ee1460b
I would like to create a more efficient method to load all the documents only the first time, so that it starts more quickly the subsequent times.