Questions tagged [android-resources]

Android resources - framework for providing different layouts or strings for android projects.

You should always externalize resources such as images and strings from your application code, so that you can maintain them independently. Externalizing your resources also allows you to provide alternative resources that support specific device configurations such as different languages or screen sizes, which becomes increasingly important as more Android-powered devices become available with different configurations. In order to provide compatibility with different configurations, you must organize resources in your project's res/ directory, using various sub-directories that group resources by type and configuration.

Documentation about providing resources and working with them.

TOPICS

REFERENCE

2524 questions
0
votes
1 answer

how can I solve the fonts name mismatch (internal name and file name) for Android Studio?

I downloaded some fonts for Android Studio and I had to rename the files to be only lowercase because it didn't let me save them otherwise. For instance, I have the file "bauhausregular.ttf" However, when I reference the fonts on the…
0
votes
0 answers

Override layout files of a library in Android

So in my project, we are overriding a preferences layout file - preference_category_material.xml from androidx.preference:preference library. Our new code of preference_category_material.xml looks something like this
SayantanRC
  • 799
  • 7
  • 23
0
votes
1 answer

Android Studio Kotlin Class doesn't find resources

I have a problem where every single resource isn't found in my kotlin class, like strings, layouts, menus, drawables, and so on. They do exist.
Julius Babies
  • 955
  • 3
  • 6
  • 22
0
votes
1 answer

Android resource linking failed, error: failed parsing overlays Android

Recently I got this error when I build my app. I did not modify anything from my last successful build. here is the error that I got Android resource linking…
0
votes
1 answer

Different integer resource values for phone and tablet?

As described here: https://developer.android.com/guide/topics/resources/more-resources#Integer I added a resource value for integer at /res/values/integers.xml Now, I would like to add the same integers.xml for tablet devices? Like it is done for…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
0
votes
1 answer

Is there a way to change the directory to which the Android Asset Studio saves resources?

Every time I use the Android Asset Studio to add a new vector drawable to my localized app, the drawable gets saved to the res-localizable/drawable folder and I need to go in there and manually change it to res/drawable. It's a pain to always have…
0
votes
0 answers

Android app does not support languages that are not in the android system for per-app languages

I have a problem, my application does not support languages that are not in the android system. When I test the APK everything is fine, but after releasing to play store I have a problem. I am trying to change languages programmatically. val…
0
votes
1 answer

Android string format with ValueAnimator

I want to show a price by using String resource with ValueAnimator. The output what i expect is like this : (123,432,133) strings_format.xml %,s
CodingBruceLee
  • 657
  • 1
  • 5
  • 19
0
votes
0 answers

Duplicate Resources for strings.xml and values.xml in app build

While adding default_web_client_id as a string resource in strings.xml, I encountered an error Duplicate Resources with build generated values.xml. I tried to delete the build generated default_web_client_id but the Duplicate Resouces error won't go…
Kaleab Woldemariam
  • 2,567
  • 4
  • 22
  • 43
0
votes
0 answers

Android - Can't find all string resource localizations

I currently have 2 localizations, English and Spanish, for an app I'm building to create recipes. Part of the recipe creation process involves doing some text parsing on each step. I am attempting to build a MutableMap of each localization and all…
0
votes
0 answers

Height screen qualifier is not taking the corresponding values

I have a dimens file that has values that will be used for dp >= 615dp (h615dp) I am testing the following device: 2055px of height screen density: xxhdpi Dp = 2055/(480/160) = 685 dp According to this answer:…
0
votes
0 answers

Android - Get ID of item at specific index in string-array resource

So I have a string-array I have defined in an XML file that is comprised of about 20 or so different string items that are defined outside the string-array container in the xml file. Each string item has it's own uniquely defined name (and also ID…
0
votes
0 answers

How to know all the dimens.xml(hYYYdp) files I have to create to support all the screen sizes?

I am a little bit desperate because I'm trying to know how can I know the exact list of different dimens.xml(hYYYdp) I have to create in order to support all the screen sizes. I think I have already seen all the related questions to mine but none of…
0
votes
0 answers

How to exclude Android resources for a particular resource qualifier

Suppose I have the following resources in my Android project: res/values/strings.xml res/values-land/strings.xml I would like to exclude the resources defined for land qualifier from packaging into apk. Is there such a possibility? And, no, I can…
Vit Khudenko
  • 28,288
  • 10
  • 63
  • 91
0
votes
0 answers

Specific dimens.xml(hYYYdp) file is not working as expected

I have the following dimens file: I have tested the app in a 240x400px (ldpi) device. So the height's dp is = 400/(120(ldpi)/160)== 533.33dp So if I am not wrong, dimens.xml(h533dp) will be used by devices whose height's dp is equal or grater to…
1 2 3
99
100