Handle and search large json file (android)

Viewed 24
  • I have a json file that have a large (~200K) data set (non-complex objects with 4 fields). I should do prefix search for some of its field.
  • There wont be any retrofit/api call, pagination stuff, or backend and all type of db's are forbidden to use.

So, I am not sure how to handle this kind of situation, I know that in order to do performant simultaneous string prefix searches, It is suggested to use trie data structure. But where I should keep and handle this big data in order to avoid OOM risk, and achieve performant UX ?

What I've currently done is: I used GSON to convert json to object list. I insert all data into a trie, and I just search queries and return results with that trie. Used coroutines to do those smoothly. Even if it didn't cause any OOM, it was totally at the limits.

0 Answers
Related