android--Resource Directory

Source: Internet
Author: User

  1. res/drawable/image-based resource files;

  2. res/layout/can be compiled into a screen layout of the XML file;

  3. Res/values/can be compiled into several types of resource files:

    (1) array.xml definition array;

    (2) Colors.xml defines color and color string values, which are obtained using the resource.getdrawable () and Resource.getcolor () methods respectively;

    (3) Dimens.xml defines dimension data, which can be obtained by resource.getdimension () method;

    (4) String.xml defines string values that can be obtained using the resource.getstring () or Resource.gettext () methods. where the GetText () method retains any rich text style that is typically described in the UI;

    (5) Style.xml defines the style object;

  4. The XML file of the res/menu/menu object can be overloaded with the Oncreateoptionsmenu () method of the activity class, using the

    Menuinflater inflater = Getmenuinflater ();

    Inflater.inflater (R.menu.menu,menu)

    code to obtain;

  5. A res/anim/xml file, which is compiled into an object that frames animation or tweened animation;

  6. Res/xml/is used to place definitions of XML files such as style, theme, or any XML file that can be read by the Resource.getxml () method at run time;

  7. res/raw/store any files that are copied directly to the device, and when the program is compiled, they are added directly to the compressed file G.zai the application can obtain resources by using the Resource.openrawresource (ID) method. The form of ID is: r.raw.filename;

    All resources will be compiled into the final apk file. Android automatically creates a class----r.java so that you can associate it to the corresponding resource file in your code. The name of the self-thunder contained in the R.java is determined by the path of the resource and the names of the files;

  8. Excerpt from: Android application development fine solution;

This article is from the "Androidcamera Summary" blog, please be sure to keep this source http://7183397.blog.51cto.com/7173397/1606765

android--Resource Directory

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.