Affects Version/s: None
Fix Version/s: Release 7.5.0
Sprint:2018 Sprint 13 SDK, 2018 Sprint 14 SDK, 2018 Sprint 15 SDK, 2018 Sprint 16 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK
On Android, accessing files/directories under "Resources" is slower than it should be. These files are stored within the APK where a list of file paths from "assets" can be easily extracted... which should make it faster than storage access.
Run the below code to fetch a listing of all files under the "Resources" directory. Observe the log for the duration of this function.
For a project have about 160 files under "Resources", I get the following results...
- Android 4.1 Emulator: 80 ms
- Galaxy Nexus (Android 4.1): 70 ms
- Amazon Fire HD 8 (7th Generation): 19 ms
- Pixel XL (Android 8.0): 3 ms
An Android APK is really a zip file. We should open the APK as a zip file and fetch/store all zip entries referencing files under the "assets" directory. This way we can have fast hash table lookups when doing existence checks and fetching directory listings.