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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:16:52+00:00 2026-06-03T20:16:52+00:00

I have a list of static key/value pairs that I need to include in

  • 0

I have a list of static key/value pairs that I need to include in my project like this one:

givenName : First Name
sn        : Last Name
mail      : Email
... snip ...

Where in an Android project would I put this?

Thanks
Eric

  • 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-03T20:16:53+00:00Added an answer on June 3, 2026 at 8:16 pm

    You need a XML file saved at res/values/strings.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="givenName">First Name</string>
        <string name="sn">Last Name</string>
        <string name="mail">Email</string>
    </resources>
    

    Here is how you can access the values from other xmls:

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/givenName" />
    

    Or this is how you can access the value from Java code:

    String string = getString(R.string.givenName);
    Log.d("Test", string); // Outputs "First Name" to LogCat console.
    

    Check this Android Dev Guide for full reference on String Resources.

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

Sidebar

Related Questions

I have a dictionary declared like this. public static Dictionary<int?, List<int?>> pegMap = new
I have this bit of code, public static List<string> GetSentencesFromWords(List<string> words, string fileContents) {
I have a method I'm writing that uses reflection to list a class's static
I am creating a class that will have a Key-Value pairing of some sort.
I have a dictionary like so - public static Dictionary<int, List<int>> pegMap = new
I have a report that shows a list with the following columns: A key
I want to create a top 5 list of unique key value pairs sorted
So I have a file that looks like this: 1st 2nd­ nth e1­, ­­v1,
I have this list of things generated from an array, where the array value
I have a utility method (= a static one) that I call a lot,

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.