I'm writing an android library and at the same time a demo app that will use my library, so far I'm writing the contents of each one on the same project but on separated packages so that after finishing I can transform the library package into a .jar . I need to store a huge amount of ininial data inside the library package and that amount of data must be available to anyone using the library. I've been doing some research and I decided to store this initial data in a .json file and read that info when needed. I've been trying to look for the best place to store the json file and the two sugested places were the /res/raw
or /assets
folders of my android studio project. The thing is this folders are located in the part of the project that belong to the demo app and not inside the package that will become the library. My question are:
- Is there a way to place the .json file outside the
/res/raw
or/assets
folders, lets say within a random package together with some .java files? - I tried storing the initialization data inside .java files and it worked for a while but then I started having problems due to java limitations with the amount of data that can be written inside a method, so I selected a .json file as the place to store the data. Should I select any other kind of file, let's say one that I could place and read from wherever I want if such thing is possible?
- I'm I forced to separate the library from the demo into two different projects?