Sunday, October 2, 2016

Android Asset Packaging Tool

Android Asset Packaging Tool

The first step in the build process involves compiling the resource files such as AndroidManifest.xml and other XML files used for designing the UI for the activities. This process is done using a tool known as Android Asset Packaging Tool (file name: aapt.exe). This tool generates a Java file named as R.java with a couple of constants inside it enabling developers to reference them from their Java code. In the following, a sample part of R.java is presented. R.java is automatically generated in this folder:

...\ImageDownloader\app\build\generated\source\r\debug\com\blogspot\gr1350\imagedownloader\




/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package com.blogspot.gr1350.imagedownloader;

public final class R {
    public static final class anim {
        public static final int abc_fade_in=0x7f050000;
        public static final int abc_fade_out=0x7f050001;
        public static final int abc_grow_fade_in_from_bottom=0x7f050002;
        public static final int abc_popup_enter=0x7f050003;
        public static final int abc_popup_exit=0x7f050004;
        public static final int abc_shrink_fade_out_from_bottom=0x7f050005;
        public static final int abc_slide_in_bottom=0x7f050006;
        public static final int abc_slide_in_top=0x7f050007;
        public static final int abc_slide_out_bottom=0x7f050008;
        public static final int abc_slide_out_top=0x7f050009;
    }
    public static final class attr {
        /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
         */
        public static final int actionBarDivider=0x7f010040;
        /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".
         */
        public static final int actionBarItemBackground=0x7f010041;
        /** <p>Must be a reference to another resource, in the form "<code>@[+][<i>package</i>:]<i>type</i>:<i>name</i></code>"
or to a theme attribute in the form "<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>".


The contents of an Android project's ..\res\  folder, such as layout\activity_main.xml, are passed by Android Asset Packaging Tool (aapt).

No comments:

Post a Comment