0

I have a app. Its minSdkVersion 23.

In start I put some of my drawable items in drawable-v24. Everything goes fine untill, I test my app on sdk version 23(Android version 6). It crash my app by giving error Resources Not found. So I move my drawable item from v24 to normal drawable folder. App works fine on Android Version 6. It still running fine on android version 8.1 and 10.

So my question is

What's the importance of drawable-v24 folder. My app is working fine even there is no item in v24 folder. I read on Internet, they say different drawable folder's are for different screen density.

In another words Question can be

Is it okey to just put all my drawable item in simple drawable folder?

Sahil Goyal
  • 340
  • 2
  • 10

2 Answers2

1

Yes, it's okay to just put all your drawable items in the drawable folder.

You may use these versioned folders (e.g. drawable-v24) to store different drawable items for different API Versions. yet you must have a drawable item with the same name in the simple drawable folder, therefore you won't receive a "Resources Not found" error while your app is running on a device with a lower API level.

Amin Takhti
  • 30
  • 1
  • 7
0

-v24 is a postfix which means sdk_int >= 24 There is nothing special about it but using this postfixed resource folders, you can override your resources on different device properties. Some most used examples are pixel density of the display (e.g. -hdpi, -xhdpi) Rotation (-landscape, -portrait) Locale (-uk, -es, ..) Api level (-v21, -v24 ...)

I guess you shouldn't have put your drawables inside drawable-v24 unless those drawables contain some properties which requires api level 24+

Amin
  • 2,169
  • 1
  • 14
  • 27