Android: Are raw resources stored locally on the filesystem?

拈花ヽ惹草 提交于 2019-12-22 18:47:08

问题


I am analyzing an APK, and see a set of .txt resources in the /res/raw/ directory of the application. After installing the application on an emulator, I would expect to see those same files in the /data/data/[app]/files directory, but they do not seem to exist. Where are the raw resources stored? Are raw resources generated at application runtime somewhere else on the filesystem? Or when they are accessed, is it dynamically from the local .apk file? Thanks.


回答1:


Raw resources (and really, all resources) are bundled in the APK file (this includes files placed in assets/), which is why you cannot get to the using File handles. The APK files themselves usually live in the system/app directory of the device.

The internal storage location you mentioned (/data/data/[app]/files) is where files created with Context.openFileInput(), Context.openFileOutput(), or Context.getFilesDir() are placed.

HTH



来源:https://stackoverflow.com/questions/7421001/android-are-raw-resources-stored-locally-on-the-filesystem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!