Alwaysblue
Alwaysblue

Reputation: 11900

Understanding res folder in Android-Java (react-native prospective)

I was reading about JAVA from Google Developer Training

The Google Developer training says

the res folder holds resources, such as layouts, strings, and images

In case of RN, images aren't stored in Res (when I go to android folder in RN) so in typical android project it is not necessary to have images in Res?

2nd

values: Instead of hardcoding values like strings, dimensions, and colors in your XML and Java files, it is best practice to define them in their respective values files. This practice makes it easier to change the values and keep the values consistent across your app.

is it like environment file?

Upvotes: 1

Views: 947

Answers (1)

LonelyCpp
LonelyCpp

Reputation: 2673

In case of RN, images aren't stored in Res

They are in fact copied into the res folder when you build a react native project for android. You can take a look at android/app/build.gradle, it will have lines saying

// where to put drawable resources / React Native assets, e.g. the ones you use via
// require('./image.png')), in release mode
// resourcesDirRelease: "$buildDir/intermediates/res/merged/release",

is it like environment file?

No, these files are more like constants file in JavaScript.

Upvotes: 2

Related Questions