What is an Android Asset?

社会主义新天地 提交于 2019-11-30 23:35:32

问题


I'm doing my first steps in Android development, and came across the term Asset.

As far as I understand it, an Asset is simply a file that is not being parsed or referensed as a resource.

Is there a more accurate definition of the term? In which scenarios should I use an Asset in my application?


回答1:


Assets provide a way to include arbitrary files like text, xml, fonts, music, and video in your application. If you try to include these files as "resources", Android will process them into its resource system and you will not be able to get the raw data. If you want to access data untouched, Assets are one way to do it.

Assets added to your project will show up just like a file system that can read from by your application using AssetManager.

Android has a dedicated folder in its project organization that stores all these files.



来源:https://stackoverflow.com/questions/12037069/what-is-an-android-asset

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