Friday, August 1, 2014
The Values Folder
"The Values Folder
This is where you place predefined application values in the form of XML files that define the variable names (x or y, for instance) and their values that are later referenced in your Java code. Think of the values folder as holding all of your constant values for your application in one place. This way, if you need to adjust them during application development and testing, you make the changes in a single location.
colors.xml: An XML file that will define the color values to be used in the app. These allow you to standardize the UI. For example, you would define your background color. Then, if you decide to tweak it later, you need to do the tweaking in only one place.
dimens.xml: An XML file that defines dimension values, such as standard heights and font sizes for your UI. You can then use these values across your app to ensure it is consistent.
arrays.xml: An XML file that defines a series of values to be used together (known as an array). For example, this could be a list of icon files or a list of options to display to the user.
strings.xml: An XML file that defines text strings to be used in the application. For example, you can place any screen titles or the app’s name here and reference them in your code. If you need to change these items, you simply do it here rather than in your code.
styles.xml: An XML file that defines styles to be used in the application. These styles are then applied to the UI elements that require them, so you separate the look of your app from the layout and functionality. This makes your app easier to maintain."
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment