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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:11:20+00:00 2026-05-29T05:11:20+00:00

In my Android application, for example when I am inserting a Button and adding

  • 0

In my Android application, for example when I am inserting a Button and adding a static value for it as follows:

android:text="MY BUTTON"

It gives a warning saying Hardcoded string "MY BUTTON", should use @string resource.

I am currently trying to extend some functionality in a previously developed app; do I have to change all those statically defined values to refer to the string.xml file?

Please can anyone give an opinion on the standard? Thanks in advance.

  • 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-29T05:11:21+00:00Added an answer on May 29, 2026 at 5:11 am

    You don’t have to fix this at all because it is a warning not an error. Your app will work perfectly well with hard-coded strings.

    That said, it is advisable to fix it because it will make translating your app to other languages much easier should that ever become necessary.

    Generally I try to always define strings in the strings.xml file because it really doesn’t take too long when developing new code. However converting an existing project to use strings.xml may be a lot of work for little gain if you are unlikely to ever need to translate your app.

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

Sidebar

Related Questions

My open-source Android application uses this in an SQL query: String.format(%f, someDoubleValue); Unfortunately, in
I make Android application which must receive data from the page http://example.com/get.php?id=1 . For
i am developing android application website address how can implemented validation example : www.yahoo.com
I am newbie in android application development. I am using the Form Stuff example
In my Android application, I add a ListView element (for example) in the main.xml
Can anyone refer me to an example for Android application using results of Google
In my android application i need to roundup tmie value.i.e I need to convert,like
I have an Android application that utilizes a paid sponsor Image Button at the
i downloaded the facebook android application example from github and imported it using the
I'm developing an android application, and I have a button which starts/pauses certain simulation

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.