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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:16:04+00:00 2026-06-12T06:16:04+00:00

What I would like to do is create a configuration/properties/xml file in an Eclipse

  • 0

What I would like to do is create a configuration/properties/xml file in an Eclipse project that can specify project settings.

The context is that I have one application meant for 2 users. But they need to have different version and build numbers and some other parameters specific for that user. What I would like is to have two configuration files, and then be able to specify Configuration file 1 or 2. The tricky part is that Version Code/name are specified in the android Manifest.

How is the best way to go about doing this?

Requirements:

  1. Specify in one part of code which configuration/properties file to use. (ie: Config 1 or 2)
  2. Android Manifest is able to reference this file for Version Code and Version Name.
  3. I can dynamically reference elements of this file in my code.
  • 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-12T06:16:05+00:00Added an answer on June 12, 2026 at 6:16 am

    So I found a good way to do this. I simply made a “configuration” xml file that has a bunch of resources in it.

    ie:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <integer name="version_code">6</integer>
        <string name="build_version">1.5</string>
            <string name="app_LOGO"> "R.drawable.my_logo"</string>
    </resources>
    

    then in my manifest I have

      android:versionCode="@integer/version_code"
      android:versionName="@string/build_version"
    

    and then I made a configuration class.

    public class Configuration {
    
        private int LOGO = 0;
    
    
        public Configuration(Context cont){
    
            String myResourceId = cont.getResources().getString(R.string.app_LOGO);
            String[] resourceParts = myResourceId.split("\\.");
            String packName = cont.getPackageName();
            int logo = cont.getResources().getIdentifier(resourceParts[2],               resourceParts[1], packName);
    
            setLogo(logo);
        }
        /**
         * @return the logo
         */
        public int getLogo() {
            return LOGO;
        }
        /**
         * set the Logo
         */
        public void setLogo(int logo) {
            LOGO = logo;
        }
    }
    

    Where I just call the Configuration class with the context of my activity passed into the constructor inside of my activities onCreate Method. Works like a charm.

    Hopefully this helps someone

    Cheers.

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

Sidebar

Related Questions

I would like to create the configuration editor plugin for my XML configuration file
I would like to create a log4net RollingFileAppender that creates a new file each
I would like to create a configuration panel for the homepage of the web-app
i would like create a array of structure which have a dynamic array :
I would like to create a c++ type that mimic the build-in type exactly.
I would like to create a class that runs something (a runnable) at regular
I would like to create an application which can learn to classify a sequence
I noticed that when I select Project Properties -> Configuration Properties -> c/c++ ->
I would like to create a property of this kind : <properties> <ignoredpackage> <ignore>com.example.*</ignore>
I would like to put some of the hibernate configuration in a property file

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.