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 6981423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:09:22+00:00 2026-05-27T18:09:22+00:00

I have been programming an Android App for a while and we want to

  • 0

I have been programming an Android App for a while and we want to release two version of it that have minor changes from one another. I am worried about the maintenance of the app once we spilt it into two (I change something in one and don’t update it in the other). What is the best way to go about this? I was thinking of creating two svn branches for each version of the app and having people commit changes to the trunk and then merge them into the branches? Is this the easiest and time effective solution?

  • 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-27T18:09:22+00:00Added an answer on May 27, 2026 at 6:09 pm

    Learn to use ant.

    http://developer.android.com/guide/developing/projects/projects-cmdline.html

    As a basic example, you can generate a build.xml file from command line, inside project directory with

    android update project -p ./
    

    Then you can make a config directory and store some items in there such as the AndroidManifest.xml and a Config.java that you keep in your package. Replace certain items with tokens, for example, build-appone.properties might read

    config.package_name=com.me.appone
    config.some_var = "foobar"
    

    and your files in config will have tokens replacing original text like, Config.java

    ...
    public static final String FOO_BAR = "@CONFIG.SOME_VAR@";
    ...
    

    Then you can edit your build.xml and add custom targets like so

    <target name="-configapp">
        <copy file="config/Config.java" todir="${source.dir}/com/me/appone/"
              overwrite="true" encoding="utf-8">
    
              <filterset>
                  <filter token="CONFIG.SOME_VAR" value="${config.some_var}"/>
              </filterset>
        </copy>
    </target>
    
    <target name="release-appone">
        <loadproperties srcFile="build-appone.properties"/>
        <antcall target="-configapp"/>
        <antcall target="release"/>
    </target>
    

    then you can build the target release-appone by either running

    ant release-appone
    

    or by right clicking build.xml, Run As -> 2. Ant Task …, followed by selecting your target and hitting the run button.

    More information can be found on ant in the interwebs.

    AndroidManifest.xml

    Worth mentioning that if you’re going to move package name, version code, and version name into a build.properties file and copy it over to the root directory using filters from config/AndroidManifest.xml, you need to account for differing package names. So no relative paths to activities in manifest and you’ll also need to customize the -pre-compile target to move the generated R.java to the correct directory (based on package name) and use the ant regex bit to fix package name in R.java, where -pre-compile is an already existing empty target set aside for your use by google

    Updating R.java

    To update R.java, you want to override the -pre-compile target, locate R.java, move the file, and use replaceregexp to edit the package name inside of the file appropriately. You can lookup documentation for each ant call to customize to your needs. Here’s an example that may contain errors with some comments on relevant portions for further reading in ant documentation.

    <target name="-pre-compile">
        <echo>Fixing R.java</echo>
        <!-- setup a prop for reuse that points to R.java containing dir -->
        <property name="config.gen_pkg" value="${gen.absolute.dir}/com/me/dir"/>
    
        <!-- this pulls a list of directories and assigns it to a refid via "id" -->
        <dirset id="config.R_loc" dir="${config.gen_pkg}" includes="*"/>
    
        <!-- this takes the refid and pushes it into a usable property -->
        <property name="prop.R_loc" refid="config.R_loc"/>
    
        <!-- now we move the file to where we want -->
        <move file="${config.gen_pkg}/${prop.R_loc}/R.java" todir="${config.gen_pkg}"
                overwrite="true" encoding="utf-8"/>
    
        <!-- use regex to update the package name -->
        <replaceregexp file="${config.gen_pkg}/R.java" match="^package com.*$"
                replace="package com.correct.package.name" byline="true"/>
    </target>
    

    You’ll need to adapt this to your own circumstances of course.

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

Sidebar

Related Questions

I have been programming in C# for a while and now I want to
I have been programming for Android with decent success, but one thing I have
I have been programming since 1999 for work and fun. I want to learn
I am new to Eclipse and Android programming in general but I have been
I've been programming Android in Eclipse for about a year now and I have
I have been working on a Android Web Services program that uses a number
I have been programming with .NET 2.0 version for quite sometime and would like
I am new to android programming and have found myself stuck I have been
I have been programming in php for a while, and recently I started a
I am new to Java programming / Android development - but I have been

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.