What is a drawable folder on android?

Asked 23-Jan-2018
Viewed 347 times

1 Answer


0

Drawable in android :

What is a drawable folder on android?


A Drawable is a folder or Directories  that contains graphical file (bitmap) like .png, .jpg, .ico, .xml etc. which would be represent in BitmapDrawable class in android.
In android, each Drawable folder stored as individual files in the res/drawable folders. Generally you would use to store bitmaps for different resolutions in the –hdpi, -mdpi, -xhdpi, -xxhdpi subfolders of res/drawable. If these bitmaps are present in different-different folder, then android automatically selects the correct one for device configuration. Some Key points of drawable folders-

  • XML drawable folder is used to contain the different type of shapes (color, border, gradient, and font-family), state, transitions and another different types of things.
  • In android, Drawable can also be written in Java code. And each object that present in Drawable folder can be used as “@drawable/objectName” in our code.