APK 擴展文件下載顯示驗證的各種進度 (APK Expansion File Download shows various progress on validation)


問題描述

APK 擴展文件下載顯示驗證的各種進度 (APK Expansion File Download shows various progress on validation)

我已將我的應用程序與 APK 擴展文件相關聯。經過很多問題,我終於可以下載我的視頻資源了。現在我注意到了下一個問題。XAPK 驗證的顯示進度總是不同且隨機的。

我的 obb 文件的文件大小是 385.956.198 字節:

    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
)};

在我的 Lollipop 設備上它總是在 366 之間和 368 MB(但絕不是 368,07):

Progress on Lollipop Device

在 Nougat 設備上的進度很奇怪。它可以是 155 MB、82 MB、102 MB...

![牛軋糖設備的進展

雖然看起來驗證沒有完成,但我可以單擊下一步並打開視頻文件。所以我不知道是什麼導致了這個問題,以及為什麼 Nougat 設備上的值遠低於總文件大小。


參考解法

方法 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.

(by Deno Agüeroanatoli)

參考文件

  1. APK Expansion File Download shows various progress on validation (CC BY‑SA 2.5/3.0/4.0)

#apk-expansion-files #Android #android-progressbar






相關問題

從擴展文件播放聲音文件 (Playing sound files from expansion file)

如何掛載加密的APK擴展文件? (How to mount encrypted APK expansion files?)

如何使用jobb工具Android創建OBB文件 (How to create OBB files USING jobb tool Android)

發布不顯示谷歌地圖的 APK 文件 (Release APK file not showing google maps)

PHP - 上傳APK到自己的服務器 (PHP - upload APK to own server)

如果從 Google Play 商店下載 apk 和 obb,則無法在 android 10 設備上訪問 obb 擴展文件 (Cannot reach obb expansion file on android 10 device if apk and obb is downloaded from Google Play store)

APK 擴展文件下載顯示驗證的各種進度 (APK Expansion File Download shows various progress on validation)

APK 擴展文件下載不起作用 (APK Expansion file download doesn´t work)

掛載 .obb 時未調用 OnObbStateChangeListener (OnObbStateChangeListener not called when mounting .obb)

可以掛載未加密的obb但加密錯誤21 (can mount unencrypted obb but with encrypted error 21)

無法在魅族 m3 note 上掛載 .obb 文件(state = 21) (Can't mount .obb file (state = 21) on Meizu m3 note)







留言討論