Android uses three directives to indicate how your app should behave for different API versions:
minSdkVersion: the minimum API version your app supports. compileSdkVersion: the API version your app should be compiled with. targetSdkVersion: the API version your app was designed for.
The ContextCompat class provides methods for compatibility with context and resource-related methods for both old and new API levels.
in this example we have a list of colors in values and same array of names that match the name of the colors in the color in the resources.
we are going to change the color of a textview randomly with the colors in the resources. see the code inside the activity.