Differences between assets directory and res directory under Androidproject file

Source: Internet
Author: User

1. Assets: does not generate the corresponding tag under the R.java file, assets directory can create its own directory, you must use the Assetsmanager class to access, the resources are stored here in the implementation of packaging will be in the program installation package,

**2. Res: Tokens are generated under the R.java file, and the resources here infer which ones are used when the package operation is performed, and the file resources that are not used are not packaged in the installation package.
Res/raw and assets directories to store files that do not need to be compiled into binary systems, such as font files * *

* * The directory can also be defined in the Res directory:
Res/anim: This is an animated resource.
Res/xml: Ability to use GetResource () in activity. GetXML () Read the resource file here
Res/raw: Files in this directory can be copied directly to the device and cannot have subdirectories. When compiling the software. The data here does not need to be compiled. Added directly to the program installation package. Usage is getresource (). Openrawresources (ID), in which the parameter ID is in the form of r.raw.xxx.**

Differences between assets directory and res directory under Androidproject file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.