From the course: Android Development Essential Training: The User Interface with Kotlin

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Create alternative resource directories

Create alternative resource directories - Android Tutorial

From the course: Android Development Essential Training: The User Interface with Kotlin

Start my 1-month free trial

Create alternative resource directories

- [Instructor] There are many thousands of different Android device models in use around the world, and your apps have to be able to adjust dynamically to whatever Android version and screen they encounter. They also have to be able to adjust whenever the user turns the device from portrait to landscape and back again. To handle these multiple devices and multiple situations, Android has a concept of alternative resource directories. When you look at your drawable directory under resources, and you're in the Android scope, it looks like there's only one directory. But if you look at that same directory in the project scope, you'll find that there are multiple versions of the directory. There's the drawable directory itself, and it contains default versions of your image files. But then, for anything that's a bitmap, such as a png or a jpg, you might find that there are multiple copies. For example, this icon that I created earlier in the course exists in the hdpi, mdpi, and all these…

Contents