Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

@2x retina image equivalent in Android

I'm converting a iOS application to android. (using android studio)

I have all my image as [email protected]

So, My 2 questions:

1- Can I copy all my @2x to ONLY folder "xhdpi", and android will auto adjust density for the devices?

2- Was "xhdpi" really the equivalent of xcode @2x ?

like image 669
Franck Avatar asked Nov 25 '15 23:11

Franck


1 Answers

You should read this as it will give you a good start on the sizes of all your images and it helped me when i was starting out developing for Android http://developer.android.com/guide/practices/screens_support.html

But basically android devices use different DPI images depending on the screen size. If you don't have the DPI that the device uses then it will apply the closest DPI, however this may give a pixilated or stretched look to your app.

There is no DPI that is equal to Retina. The following are some of the screen sizes based off MDPI which is the same size as non-retina.

  • MDPI = Non-Retina = 100% image
  • HDPI = 150% image
  • Retina = 200% image
  • XHDPI = 225% image

http://www.teehanlax.com/blog/density-converter/

You will need to have a folder in your images folder for each DPI that your app will support. If your going to be working with the latest devices only then you will probally only need HDPI, XHDPI and XXHDPI

like image 95
Jetpack Avatar answered Sep 30 '22 01:09

Jetpack