0
\$\begingroup\$

i have a big library on my game. its word library. there is no need of it to be on ram.any moment some part of it can be searched so there is no need to make a list or dictionary for it. is there any type of file data that can be added to apk file?

\$\endgroup\$
2
  • \$\begingroup\$ If I understand correctly, would it work to simply include the file with all the words in it (so its not loaded in ram) and then have a script file that can search it for specific words (which will load the word file into ram when you need it) ? \$\endgroup\$ Commented Aug 22, 2018 at 13:29
  • \$\begingroup\$ @TomTsagk yes you are right \$\endgroup\$
    – virtouso
    Commented Aug 22, 2018 at 13:47

1 Answer 1

2
\$\begingroup\$

I'm not sure how your library is organised, but it seems it's just a data library with some interface to access such data.

You can have a separate file with all the data you need (the words) which can be in any format you like (a raw text file, or a json file etc), then you'll need one script file, to access that data and load/unload the file at will. The script file can be structured to call first LoadFile() and then FindWord(String word) followed by UnloadFile(), to make sure the data are not in ram when not needed. This assumes you will need to find plenty words in a short period of time (like a bunch of words for every stage of a game?).

I assume your current library is already in Java, so it would be fairly easy to change it to fit the above description. There are also plenty json parsers for android online which you may be able to use, so you don't have to bother on parsing the file yourself.

\$\endgroup\$
2
  • \$\begingroup\$ is a sqlite table a good choice? \$\endgroup\$
    – virtouso
    Commented Aug 22, 2018 at 14:02
  • \$\begingroup\$ @virtouso It can be done, but weather its a good choice or not depends on your familiarity with it. If you've used it before, and you know it works and how, I don't see why not. \$\endgroup\$ Commented Aug 22, 2018 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .