0

I have my external app related db file which I want to load and read from my native lib (.so) after the apk is installed on the phone. The file is completely READ_ONLY. I read through several docs, and came to know that I can place my file into my asset folder, but Android puts restriction on asset size that can be read at time, to 1Mb. In case our file is bigger than that, we have to split it into chunks and read.

Other option I got is that I can copy my file from asset folder to internal storage and read from there. In this case, the file in asset folder will be useless after it is copied.

But my doubt is, are these the best practice that everybody is doing to achieve the same situation? or any best solution here which I am not able to look.

kaddy
  • 109
  • 11
  • If you think that the file can only be 1 MB then what sense does it make to copy it to internal storage? – blackapps Sep 16 '21 at 07:07
  • `on asset size that can be read at time, to 1Mb.` ?? Do you mean file size? That you cannot place files in it bigger than 1MB? Or total file size? Or what exactly? – blackapps Sep 16 '21 at 07:09
  • My file size is between 4-12 mb. But I read that we have to read file in asset folder in chunks of 1mb if it is greater than 1mb of size, It throws error. https://stackoverflow.com/questions/2860157/load-files-bigger-than-1m-from-assets-folder – kaddy Sep 16 '21 at 07:24
  • `My file size is between 4-12 mb.` You mean MB instead of milli bit? Well does that file fit in assests? Can you compile and install your app with it? Dont read yet. I asked if you could place big files in assets. – blackapps Sep 16 '21 at 07:55
  • If the answer is yes than just try to copy the file to storage. Does it go? No? Then post your code please. – blackapps Sep 16 '21 at 07:58

0 Answers0