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
0 answers

How to reference the resources of a library in a library?

Let me give a simple example. An Android Studio project has two modules: MyApp MyLibrary MyApp is an Android app and MyLibrary is an Android library used by MyApp. IMPORTANT:MyLibrary is a module with all the source code. It is a project inside…
Hong
  • 17,643
  • 21
  • 81
  • 142
0
votes
0 answers

Illegal char <:> at index 47: com.example.appName.app-mergeDebugResources-154:/values/values.xml

This error appears when trying to put these two implementations for ZegoCloud: implementation 'com.github.ZEGOCLOUD:zego_uikit_prebuilt_call_android:+' implementation 'com.github.ZEGOCLOUD:zego_uikit_signaling_plugin_android:+' And the error is…
0
votes
2 answers

Resources$NotFoundException - Resource ID #

I am facing a lot of issue regarding Resoures$NotFoundException with many different device. I am unable to replicate this issue with my Samsung A50 (Android v11, One UI v3.1) and Nexus 5 (Android v6.0.1) devices. After I am using App Bundle this…
0
votes
1 answer

How can I access theme color attributes via R.attr.colorPrimary

I'm using Android Studio Electric Eel and I started with a new "Basic Activity" project. It comes with a light and dark theme, /res/values/theme.xml /res/values-night/theme.xml
0
votes
2 answers

How to implement a circular xml in main activity android studio

I am working on creating a traffic light application. its very simple just a TextView and button. I wanted the TextView to be circular so I created a recourse file in drawable called circular and set it as the label background.
Aimex
  • 51
  • 6
0
votes
0 answers

Jetpack Compose: Resource Not Found in ComposeView

I am creating ComposeView in fragment using ComposeView like so: override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { return ComposeView(requireContext()).apply { setContent…
0
votes
1 answer

android.content.res.Resources$NotFoundException: Resource ID #0xffbb86fc

I am getting below error while sending color resource id from main app to library app (both is handled by me). In main app, Theme is being changed dynamically so, I am passing the resource id of main app theme's primary color by adding it in intent…
Nishant
  • 32,082
  • 5
  • 39
  • 53
0
votes
0 answers

I keep getting this error when run my code android.view.InflateException: Binary XML file line #43 in com.example.projectmpa:layout/activity_hamstring

I am new to Android Studio and am currently working on creating my first app. Unfortunately, I am encountering an issue that I am struggling to resolve.P.S"First time asking in Stack" this is the Layout file. the error that i mostly get is related…
0
votes
0 answers

How does Android does localisation for strings internally?

We have a localization module in our projects, We only maintain one default string folder, The localisation module keeps string value in dB for all the supported languages, and we have extended the Resource class. @Override public String…
Vikas Pandey
  • 1,115
  • 1
  • 15
  • 25
0
votes
2 answers

how to get a value from resource file in the main Activity class when using fragments?

I'm developing an app with fragments and I want to use a value from "strings.xml" in MainActivity.kt. These are the names of the tabs. But, if I do this: private var title: String = getText(R.string.title).toString() I get this error when I run the…
0
votes
1 answer

How to reference a color in a android xml resource that is defined in a lib?

I have an android fragment app/src/main/res/layout/fragment_main.xml that references a color bg_line defined in app/src/main/res/values/colors.xml res/values/colors.xml : #E7E7E7 ... fragment_main.xml…
k3b
  • 14,517
  • 7
  • 53
  • 85
0
votes
0 answers

Find exact xml file causing issue during resource shrinking

I am having shrinkResources true enabled in my Android project. When I am running the app is release mode, its throwing the below error. ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. I am able to suppress the issue…
Gowtham K K
  • 3,123
  • 1
  • 11
  • 29
0
votes
1 answer

How I can convert 10dp in different dimen file

What is the value of 10dp in below dimen file. sw320dp sw480dp sw600dp also provide calculation formula I will calculate different different way but it not show properly.
0
votes
0 answers

Passing Resources as a variable does not work as expected

I am writing a plugin for a third-party app. The plugin app loads a library through maven that executes majority of the tasks. Imagine it as the plugin app handles everything UI related (clicks, drawing, etc), while the library handles the…
kristyna
  • 1,360
  • 2
  • 24
  • 41
0
votes
1 answer

Resources$NotFoundException: Resource ID

I am trying to figure this issue but I don't understand why my Vector/png drawable is missing when I put them all in respective directory/folder. Here is the below logs. Fatal Exception: android.view.InflateException: Binary XML file line #42 in…