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

The Archive Base Latest Questions

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

In my Android application, I need to have different configurations for different environments such

  • 0

In my Android application, I need to have different configurations for different environments such as development , UAT , Production.

I have 2 ways to implement it in my mind. Please enlighten me with your opinion.

1). By using 3 different .properties files OR
2). By creating a baseconfig class for shared configuration and extends from 3 configuration classes (I am not sure if it is a good idea)

Both methods will be loaded later into a static config class for easy access.

What are the Pros and Cons of each methods?
Are there any other alternatives?

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

    I think that best way is to have one active .configuration file, which for example you may store in assets folder. Idea about tree files does not seem to be good, since you need to pack all three .properties files to .apk despite the fact that you don’t use two of those three files. Your code always reads same .properties file, and you decide which type of build you do by copying proper .properties file.

    In your project, you may create configuration folder, in which you will have all three .properties files ready. Then you create, for example, three ANT tasks, each of them will copy one properties file to assets folder with same destination file name. You may do this also any other way (.bat on Windows, .sh on Linux, you may parametrize ANT task to have one task and property which says which file to pick…).

    So, when you want to build production version, run task production, which will copy production .properties file for you. Then you build .apk. Of course, all this can be integrated into complete ANT build process where you may do step of copying .properties file at the beginning of the build procedure.

    This way you get optimal size of the APK and always same code to handle .properties file. It is also suitable for automated building environments (Hudson, for example) where you may automate your build target “from outside”.

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

Sidebar

Related Questions

Newbee to Android development. I am developing a application, which have three different tabs.
I need to create application shortcuts on 3 different mobile environments, WP7, Android and
I need to develop application for Android with Adobe AIR. I have different sets
I have an application, that need to run in 2 different devices: 600x1024 &
I have used facebook application for one of my android application. But i need
I have different screen to work in an android application. I'm using ViewFlipper for
I have been developing Android application, and I need to read PDF-files in my
In one of my Android Application I need to keep the title bar same
I need to add a shake feature that will refresh my Android application. All
In Android application development, I frequently go through the word CallBack in many places.

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.