Reputation: 1315
I'm an Eclipse developer and recently switched to Android Studio.
I know that "drawable" folder is where I must upload all the images I'm going to use in my Android project but, what happens with the image sizes? In Eclipse there are different folders for each size (xxhdpi, xhdpi, hdpi...)
What method should I use now to get the best compatibility with images and devices?
Thanks.
Upvotes: 8
Views: 16626
Reputation: 13129
The easiest way is to use Resource Manager, it allows to upload our images from Android studio itself and then resize it with each density
Upvotes: 0
Reputation: 127
Right click drawable
-> New
-> Image Asset
-> Asset Type: Action Bar and Tab Icons
. Image file: image_path
, Resource Name: how_youre_image_will_be_called
-> Next
-> Finish
Done
This will add 4 different sizes of your image so that it will fit depending the device size (phone, tablet...)
You can also ctrl+c
-> ctrl+v
to drawable folder and pick the size you want (mdpi - phones, xxhdpi - tablets...) but it would not resize by devices type
Upvotes: 8
Reputation: 536
Studio is generate image klasor automotacly. just suld make like this. ic_launcher 36*36 ic_launcher 48*48 and other image resizes. But one thing changed.Now ldpi is dont create.
Upvotes: 0
Reputation: 1006614
In Eclipse there are different folders for each size (xxhdpi, xhdpi, hdpi...)
They are there in Android Studio too. The Android Tools team kinda hid them.
If you look just above the project explorer tree thingy on the left, you should see a drop-down, one that probably says "Android" right now:
That is the Android project view, one that gives you a somewhat synthetic look at your project, collapsing things like resource sets and sourcesets to hide those details.
Eclipse users will probably be happier with the classic project view, which you get by clicking that drop-down and switching it to "Project":
This works much like Eclipse's Package Explorer, where you get an actual filesystem view of what's going on, complete with resource set directories.
It's all the same stuff on the filesystem, but the Android project view masks it a bit.
Upvotes: 13