The difference between several resources in Android

Source: Internet
Author: User

What is the difference between including the assets folder, the Res folder, and the Res/raw folder in the Android app to hold the resources for our application?

Assets folder : for storing static files that need to be packaged into the installer, the resources stored here will be stored intact in the installation package and will not be compiled into binary. Unlike res, assets supports subdirectories of any depth (that is, subfolders can be created under that folder ). These files do not generate any resource tokens , and must use the relative pathname of the/assets to start (but not contain) the Assetmanager class access, which is read through the file stream.

Res: The resources used to store the application (superscript, interface layout, etc.) will generate tokens in the R.java file, where the resources will be judged if they are used at the time of packaging. Unused resources will not be packaged in the installation package . There are some fixed subfolders under this folder, but you cannot create subfolders at any time.

Res/raw: The original resource file is stored in the folder, the file will be saved to the device intact , will not be compiled into binary form , can be referenced by r.raw.xxx, using GetResource (). Openrawresources (r.raw.xxx)for reading and writing. Subfolders cannot be created under this folder.

The difference between several resources in Android

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.