Organize resource in Android



Directory Resource Type
anim/ XML files that define property animations. They are saved in res/anim/ folder and accessed from the R.anim class.
color/ XML files that define a state list of colors. They are saved in res/color/ and accessed from the R.color class.
drawable/ Image files like .png, .jpg, .gif or XML files that are compiled into bitmaps, state lists, shapes, animation drawable. They are saved in res/drawable/ and accessed from the R.drawable class.
layout/ XML files that define a user interface layout. They are saved in res/layout/ and accessed from the R.layout class.
menu/ XML files that define application menus, such as an Options Menu, Context Menu, or Sub Menu. They are saved in res/menu/ and accessed from the R.menu class.
raw/ Arbitrary files to save in their raw form. You need to callResources.openRawResource() with the resource ID, which isR.raw.filename to open such raw files.
values/ XML files that contain simple values, such as strings, integers, and colors. For example, here are some filename conventions for resources you can create in this directory −
  • arrays.xml for resource arrays, and accessed from the R.array class.

  • integers.xml for resource integers, and accessed from the R.integer class.

  • bools.xml for resource boolean, and accessed from the R.bool class.

  • colors.xml for color values, and accessed from theR.color class.

  • dimens.xml for dimension values, and accessed from the R.dimen class.

  • strings.xml for string values, and accessed from theR.string class.

  • styles.xml for styles, and accessed from the R.styleclass.

xml/ Arbitrary XML files that can be read at runtime by callingResources.getXML(). You can save various configuration files here which will be used at run time.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值