Android Project Resources, 49/100 Days of Code
Using Application Resources makes it easier to maintain your project.
Images, Strings, and Colors are just a few examples of the resources you can use in your applications. Android projects allow you to store these files separate from your code.
This is useful in the event you need to isolate potential errors and maintain your code. The Android website has plenty of information on this topic. You can find my source code for an example project here and a video of my explanation at the bottom of the page.
The colors.xml file contains resources which determine the colors used in your app. Here you can see how your application determines different colors in your app’s theme.
As you can see, the resources added to the colors.xml file can be used in other areas of the app such as the styles.xml file. In other words, the colors added can be used for styling as well.
I’ve created a new Android Studio project for the next tutorial. I went ahead and added a few custom colors of my own to the colors.xml file. Feel free to do the same in preparation for the next tutorial. The Android website has plenty of information on this topic. You can watch my video below and view my source code here.
Join the mailing list to see updates like this every week!
Coding Fanatic