1

I've connected my application with an APK Expansion File. After a lot of problems I can finally download my video resources. Now I've noticed the next issue. The displaying progress for the XAPK validation is always different and random.

The file size of my obb file is 385.956.198 bytes:

    private static final XAPKFile[] xAPKS = {new XAPKFile(true, // true signifies a main file
        8, // the version of the APK that the file was uploaded
        385956198 // the length of the file in bytes
)};

On my Lollipop device it is always between 366 and 368 MB (but never 368,07):

Progress on Lollipop Device

On the Nougat device the progress is very strange. It can be 155 MB, 82 MB, 102 MB...

![Progress on Nougat Device

Although it looks like the validation is not complete I can click on next and can open the video files. So I don't have any ideas what causes this problem and why the values on the Nougat device are far below the total file size.

Deno Agüero
  • 519
  • 2
  • 9
  • 27

1 Answers1

1

copied from here

The problem here is, the total size is being calculated on the entries within the zipped file, which is resulting in uncompressed size of the files within the zipped file. And the progress is being displayed on the basis of the same.

  1. First solution is that for checking expansion file availability, keep the check as it is in your app, but for calculation supply the original size. The calculations are being done for zipped entries in zip file library, modify it accordingly, if possible. (I have not tried this solution.)

  2. Second one is, compress the files in a way that files inside the folder are uncompressed. In this case you will have nothing to do, but drawback will be that user has to download a bit larger size of file.

anatoli
  • 1,663
  • 1
  • 17
  • 43