Why is AssetManger.list() so slow?

后端 未结 4 808
遥遥无期
遥遥无期 2021-01-18 03:25

I\'m trying to populate a ListView with a mixture of files stored on the SDcard AND stored as assets in the APK. Using TraceView, I can see that the performanc

4条回答
  •  甜味超标
    2021-01-18 04:04

    You can approach APK package as it's a ZIP file and read all the entries using Java's builtin ZipFile. It will give you all the file names with their full paths. Perhaps it shouldn't be hard to find which directories you have.

    So far this is the fastest approach I've tested.

    credit goes to @obastemur's commit on jxcore-android-basics sample project

提交回复
热议问题