alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Android example source code file (alias_rules.xml)

This example Android source code file (alias_rules.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Android by Example" TM.

Java - Android tags/keywords

create, input, m, no, packages, rules, the, tools, utf-8

The alias_rules.xml Android example source code

<?xml version="1.0" encoding="UTF-8"?>
<project name="alias_rules" default="package">

    <!-- No user servicable parts below. -->

    <!-- Input directories -->
    <property name="resource-dir" value="res" />

    <!-- The final package file to generate -->
    <property name="out-package" value="${ant.project.name}.apk" />

    <!-- Tools -->
    <condition property="aapt" value="${android-tools}/aapt.exe" else="${android-tools}/aapt" >
        <os family="windows"/>
    </condition>
    <condition property="adb" value="${android-tools}/adb.exe" else="${android-tools}/adb" >
        <os family="windows"/>
    </condition>
    <property name="android-jar" value="${sdk-folder}/android.jar" />

    <!-- Rules -->

    <!-- Packages the manifest and the resource files -->
    <target name="package-res">
        <echo>Packaging resources...
        <exec executable="${aapt}" failonerror="true">
            <arg value="package" />
            <arg value="-f" />
            <arg value="-M" />
            <arg value="AndroidManifest.xml" />
            <arg value="-S" />
            <arg value="${resource-dir}" />
            <arg value="-I" />
            <arg value="${android-jar}" />
            <arg value="-F" />
            <arg value="${out-package}" />
        </exec>
    </target>

    <!-- Create the package file for this project from the sources. -->
    <target name="package" depends="package-res" />

    <!-- Create the package and install package on the default emulator -->
    <target name="install" depends="package">
        <echo>Sending package to default emulator...
        <exec executable="${adb}" failonerror="true">
            <arg value="install" />
            <arg value="${out-package}" />
        </exec>
    </target>

</project>

Other Android examples (source code examples)

Here is a short list of links related to this Android alias_rules.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.