Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9168995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:45:54+00:00 2026-06-17T15:45:54+00:00

I have a script to filter src, res, libs etc. (based on the device

  • 0

I have a script to filter src, res, libs etc. (based on the device type) from Android project folder to another specific folders. For example type 1 and type 2 device will have following structure after running the script.

Device_Type_1
  \src
  \res
  \libs
  \assets
  \AndroidManifest.xml

Device_Type_2
  \src
  \res
  \libs
  \assets
  \AndroidManifest.xml

I have to write a script to make build using the above folder names. I tried out ant release command but it’s throwing Java compilation error.

I like to know is there any command/script where I can pass path of src, res, lib, asset and manifest file as parameters and can build project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:45:55+00:00Added an answer on June 17, 2026 at 3:45 pm

    Not sure if I understood you correctly, but here’s my script I use to build different apks for tablets and phones:

    <?xml version="1.0" encoding="UTF-8"?>
    

    <property file="local.properties" />
    
    <property environment="env" />
    
    <property name="temp.dir" location="bin/temp" />
    
    <property name="resource.absolute.dir" location="${temp.dir}/res" />
    
    <property name="resource.source.dir" location="res" />
    
    <condition property="sdk.dir" value="${env.ANDROID_HOME}">
        <isset property="env.ANDROID_HOME" />
    </condition>
    
    <loadproperties srcFile="project.properties" />
    
    <fail message="sdk.dir is missing. Make sure to generate local.properties using &apos;android update project&apos; or to inject it through the ANDROID_HOME environment variable." unless="sdk.dir" />
    
    <import file="${sdk.dir}/tools/ant/build.xml" />
    
    <macrodef name="prepare-temp-dir">
        <attribute name="target" default="phone" />
        <sequential>
            <delete dir="${temp.dir}" />
            <mkdir dir="${temp.dir}" />
            <mkdir dir="${resource.absolute.dir}" />
            <!-- Probably should rewrite this with ant-contrib -->
            <if>
                <condition>
                    <and>
                        <equals arg1="@{target}" arg2="phone" />
                    </and>
                </condition>
                <then>
                    <copy todir="${resource.absolute.dir}">
                        <fileset dir="${resource.source.dir}" casesensitive="no">
                            <exclude name="/*sw600dp*/**" />
                            <exclude name="/*large*/*" />
                            <exclude name="/*xlarge*/*" />
                        </fileset>
                    </copy>
                </then>
    
                <else>
                    <if>
                        <condition>
                            <and>
                                <equals arg1="@{target}" arg2="tablet" />
                            </and>
                        </condition>
                        <then>
                            <copy todir="${resource.absolute.dir}">
                                <fileset dir="${resource.source.dir}" casesensitive="no">
                                    <exclude name="/*small*/**" />
                                    <exclude name="/*normal*/*" />
                                </fileset>
                            </copy>
                        </then>
                    </if>
                </else>
            </if>
        </sequential>
    </macrodef>
    
    <macrodef name="clean-temp-dir">
        <sequential>
            <delete dir="${temp.dir}" />
        </sequential>
    </macrodef>
    
    <target name="release-phone">
        <echo message="Starting build procedure for target 'phone'" />
        <prepare-temp-dir target="phone" />
        <clean-temp-dir />
    </target>
    
    <target name="release-tablet">
        <echo message="Starting build procedure for target 'tablet'" />
        <prepare-temp-dir target="tablet" />
        <clean-temp-dir />
    </target>
    

    It just extends standard android build.xml and slightly modifies it. When build starts, I create a temp dir and copy all the resources I need for the target, then build from that temp dir.

    Right now it just separates drawable folders, but you can tweak it easily to accomplish your goals

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this script: <script type='text/javascript' src='js/jquery-1.4.4.mi.js'></script> <script type='text/javascript'> $('.filterMonth').change(function(){ alert('ijijiji'); $.ajax({ url: 'ajax/filterMandays.php',
I have this script. <script type='text/javascript' charset='utf-8'> $(window).load(function(){ window.loadIframe = function(frame) { var link
I have a script that is scraping URLs from various sources, resulting in a
I have this script that basically will show a product or products based on
I have a PHP script with the following line: $query = SELECT * FROM
I have a script along the lines of: if (!require(tcltk2)) {install.packages('tcltk2', repos=http://cran.us.r-project.org); require(tcltk2)} base
What I have is a little jQuery based script intended to grayscale an image.
i have a script which takes data from a database and displays it on
I have a filter and used this script for the filter. filteredData = filteredData.filter(function()
I have a Python script adapted from Downloading MMS emails sent to Gmail using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.