I want to have a image (0.5in*0.5in) for my game for all devices but image size changes for different device. I used 0.5in( not dp) as layout width and layout height.I am working on android studio 2.3.3
Asked
Active
Viewed 82 times
-1
-
0.5in( not dp) this is where you are wrong – Shubham AgaRwal Oct 17 '17 at 05:37
-
What should I do?@Killer – BTS Jimin Oct 17 '17 at 05:40
-
you should use dp only this will help you https://developer.android.com/training/multiscreen/screensizes.html i am not sure about game but android apps this doc will help you – Shubham AgaRwal Oct 17 '17 at 05:42
-
Create that same size image in photoshop then select new and set the sizes in dp as 1080x1920 and create then move the previously created image to this artboard and fix it wherever on the screen you want as 1080x1920 dp is a FHD screen size. This will be the best way to get screen size optimized image and then you can convert this image for various screen sizes. – Lalit Fauzdar Oct 17 '17 at 05:46
-
remember the ratio mdpi:hdpi:xhdpi:xxhdpi:xxxhdpi = 1:1.5:2:3:4 and by choosing 1080x1920 you are creating an image for xxhdpi. So you can convert the image resolution according to this ratio then the image will look same in every screen size device. – Lalit Fauzdar Oct 17 '17 at 05:48
-
Possible duplicate of [What is the difference between "px", "dip", "dp" and "sp"?](https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp) – Rapunzel Van Winkle Oct 17 '17 at 06:14
1 Answers
0
for different Android devices, Android deal with Images with different densities with these standards mdpi:hdpi:xhdpi:xxhdpi:xxxhdpi, there are many ways to convert your Images to these standards and it's boring to use photoshop to do that so these links will help you to change the size of your Images easily. https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#&sourceDensity=320&name=example
and https://github.com/leocadiotine/fred this one is awesome

Ezaldeen sahb
- 719
- 7
- 12