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

Dynamically show images from resource/drawable

I have few images in res/drawable folder. I have a SQLite DB. I have a GridView where I display all the images. I select a image and fetch corresponding URI of the image selected. Now when I select the image the URI is displayed in EditText. Then I…
0
votes
1 answer

How to make modules/library resources private android

I do according to documentation module common created res/values/public.xml Also tried res/values/strings.xml
0
votes
1 answer

What is the difference between creating different dimens files directly and creating different values files with different dimens files?

What I want is to have different dimens.xml files for each different screen size device. I have searched for information and I have seen in all the posts I found that they follow second path but I have not found any post which follows first path as…
0
votes
2 answers

Custom strings file

I'm wondering if there is a way to force getting strings from the custom file? Let's say I would like to have testing strings set and use them in the debug mode. As far as I know, there is no possibility to create a custom Locale and use for example…
falsetto
  • 789
  • 2
  • 11
  • 35
0
votes
0 answers

Localazy task ordering issue

I set up a localazy project, the plugin works, but the output files are not used in the app. I think it is due to the fact that they are not correctly merged during the build. Does it have to do with gradle tasks execution order? Gradle detected a…
Fundhor
  • 3,369
  • 1
  • 25
  • 47
0
votes
0 answers

Resources$NotFoundException getting Drawable from resId for some devices

Running into few users getting Resources$NotFoundException from fetching a Drawable resource that's a png: ResourcesCompat.getDrawable(context.getResources(), R.drawable.ic_clear_black_24dp, null) I double checked that this Drawable is in…
ono
  • 2,984
  • 9
  • 43
  • 85
0
votes
0 answers

Share resources in modular structure in android

Currently I am using a modular structure in my android apps. I am using namespaces in gradle files. android { namespace = "com.example.modulename" } By using namespaces, the resource files are separate and are not accessible in other modules.…
0
votes
0 answers

d2j-dex2jar classes.dex not working in windows 11

I tried to decompile my android app and follow this one: Is there a way to get the source code from an APK file? When i tried to run d2j-dex2jar classes.dex It give error. nothing happed next d2j-dex2jar : The term 'd2j-dex2jar' is not recognized as…
0
votes
0 answers

How to change preview color of the drawable icons in Android Studio depending on theme color?

All vector icons in Android are white by default (generated by Google Fonts or Vector Assets), but have a tint set to ?attr/colorControlNormal. When we look at asset previews, Android Studio doesn't render this tint, it just uses the base color. In…
0
votes
0 answers

How to store audio files and their metadata (names) so that they can be easily localized?

I need to store audio files and their metadata (names). There was an idea to just take the name from the file name, but I ran into a localization problem. It would be possible to set a string resource pointing, depending on the locale, to different…
0
votes
1 answer

Suppress Android Studio spell check within a specific resource file

I have a case of a lot of UI strings in Android strings.xml resource files, such as sol3, which are not words, and which do not belong in a dictionary. I would like to disable lint spell check for those strings, on a per-element basis, something…
0
votes
1 answer

Runtime Resource Overlay can't be enabled

I was following some tutorials on how to create custom Runtime Resource Overlay (RRO) APKs, but I am not able to enable mine. adb shell cmd overlay list ... com.example.mytarget --- com.example.myoverlay Google said that --- mean that it is…
0
votes
0 answers

Adroid apk has assigned values to %d. Changing it to 20%d only outputs 20 before the assigned value. how can I add 20 to %d so output is sum of the 2

For example Coins %d Jus to change the number to be displayed in app such %d + 20 = 30 when %d is 10. And not 20%d which just gives out 2010 when %d is 10
Raphael
  • 1
  • 1
0
votes
1 answer

Android: pixelization of upscaled/downscaled resources

I have a problem with the "pixelization" of the embedded icons (main/res) on some devices. It can be reproduced on some Android 9 TV boxes and it happenes when an icon is upscaled/downscaled somehow (see images as example). But I do not know why it…
don11995
  • 715
  • 6
  • 18
0
votes
0 answers

Nested view's attribute set

I have a layout which contains 4 TextInputEditText views: А. TextInputEditText defined with parametes in XML inside TextInputLayout B. TextInputEditText defined with parametes in XML without TextInputLayout C. TextInputEditText created w…
1 2 3
99
100