Res/raw and assets folders for Android

Source: Internet
Author: User

In Android development, the Res/raw and assets folders can be used to store files that do not need to be compiled into binary files, such as font files. These two folders have many similarities, for example, you can copy the objects in the folder to the application.ProgramDirectory, but there are some differences between the two folders. First, the access method is different. The res/raw folder cannot have subfolders, and resources in the folder can be used.Getresources (). openrawresource (R. Raw. ID), and the assets folder can be created by itself, and the items in the folder will not be indexed by the R. Java file, and must be accessed using the assetsmanager class.

In addition, some earlier Android systems have limits on the resource size of RES/raw and assets folders (<1 m, in fact, the underlying Processing Mechanism of files in the Res/raw and assets folders is the same for Android systems). android2.2 seems to have relaxed (or canceled) This restriction (at least 10 MB can be stored, no tests .)

Related Article

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.