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

  • SEARCH
  • Home
  • 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 6678107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:12:13+00:00 2026-05-26T04:12:13+00:00

I would like an Android build system procedure, command line or Eclipse, to generate

  • 0

I would like an Android build system procedure, command line or Eclipse, to generate several .apk files from a single source codebase. Some common reasons for this – having specific versions for markets with different requirements or a free and paid version.

This question IS NOT ABOUT:

  • Packaging shared code into Android libraries or into external Java jars

  • Producing a debug vs. signed release .apk

Google says “you probably need to create separate Android projects for each APK you intend to publish so that you can appropriately develop them separately. You can do this by simply duplicating your existing project and give it a new name.” Then they kindly suggest using libraries, which I understand. Then, they mention in passing exactly what I do want: “a build system that can output different resources based on the build configuration”

  • I know that to accomplish conditional compilation in JAVA one can key off a ‘public static final’ variable. There is an example of tweaking such a value in build.xml. Any more complete example of an Android Ant build configuration for this or a link to an OSS project doing that now, please? BTW, build.xml is auto-generated, but I have seen people hacking it, so how does that work?

  • With the package name declared in Manifest.xml as package=”com.example.appname”, if one needs to emit multiple .apks that vary that name, is one stuck with a separate project for each?

  • 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-05-26T04:12:13+00:00Added an answer on May 26, 2026 at 4:12 am

    I’m generating 2 different APK’s (demo and production) from one single source tree with 3 small modifications:

    1) I have public static final DEMO=true; //false; in my Application class and depending on that value I used to switch code between demo/production features

    2) There are 2 main activities, like:

    package mypackage;
    public class MyProduction extends Activity 
    {
        //blah-blah
    }
    
    package mypackage.demo;
    public class MyDemoActivity extends mypackage.MyProductionActivity
    {
        //blah-blah
    }
    

    3) And in the end 2 separate AndroidManifest.xml files which points to different launcher activities depending on demo/production switch

    I’m switching between 2 APK’s manually, but see nothing difficult in writing small ANT task to switch between them automatically

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

Sidebar

Related Questions

I would like to build several android projects that reference the same jar files
i would like to buy a new cell phone that runs Android. From what
I would like to build an Android application that works with online database. The
I would like to build an Android application that, via an OCR library, should
I am using phonegap for build android apps. I would like to detect user's
I would like to produce 2 builds of my Android app: one build which
I have several android devices I would like to test on. Currently, when I
My program is targeting Android 1.5. I would like to retrieve system information about
We are about to build a new company Android app and would like to
I would like to reuse the exact same font-face etc... like Android uses in

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.