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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:15:00+00:00 2026-06-08T13:15:00+00:00

(Android-Noob) I can’t find a best approach for encapsulating configuration resources. Basically I’d like

  • 0

(Android-Noob)

I can’t find a best approach for encapsulating configuration resources.

Basically I’d like to keep configuration values like these:

<string name="environment">dev</string> 
<integer name="lookup_timeout">750</integer> 
<boolean name="use_cache">true</boolean>
  • all in one place,
  • in a single xml-file
  • accessible from Java through some kind of unified method (R.config.environment)

Anything I’m missing?

Update: What are configuration resources?

A set of values that typically is environment specific and will most probably change / being fine-tuned by the developer during application development. It is certainly not user-modifiable, and though has nothing to do with user-preferences.

Typical examples are:

  • the general log level
  • the place where logs are written to
  • the urls of servers (development / integration / production)

C’mon, you must know what I mean 😉

  • 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-08T13:15:01+00:00Added an answer on June 8, 2026 at 1:15 pm

    A set of values that typically is environment specific and will most probably change / being fine-tuned during application development.

    Your XML is almost verbatim what you can put in a values resource file. In your project’s res/values/ directory, create a configuration_resource_that_is_environment_specific.xml file (or whatever you wish to call it — the name does not matter). In there, you can have string, integer, and boolean resources. You would retrieve those at runtime via a Resources object, which you can get via a call to getResources() from any Context, such as your Activity.

    You can also then override those resource values via other resource sets (e.g., res/values-v11/ for versions of those values that should be different for API Level 11+).

    That being said, I think most people just store this stuff in static data members in Java for simplicity.

    C’mon, you must know what I mean 😉

    Not only is “configuration resource” unclear, but so is “environment specific”, since we do not know what you consider your “environment” to be.

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

Sidebar

Related Questions

Android comes with lots of system resources ( android.R ) that can be used
android noob... I have two tables, with a one to many relationship between country_tbl
noob Android/JSON person here. I hope someone might help me? I've looked and looked
I'm writing my first android app (I'm a noob at android, but decent at
Android is based on Linux; can native Linux applications be run on Android?
Android Code Style Guide defines Android Code Style Rules. To conform to these rules
I'm kinda noob to android so please bear with me. I'm currently developing app
Hii everybody , I am noob at android and need some help... I am
Im an Android noob, coming from objC, I have a very stupid question (project
I'm kind of a noob in the android world, and doing a pet project

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.