简体   繁体   中英

Android: Are raw resources stored locally on the filesystem?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM