My app is almost done , but the problem is that it's layout has been designed only for small screens by now
and
I want to make it for other sizes ,too
I mean to use drawables with higher resolutions in bigger screens
how should I manage it?
You can use this tool Android Asset Studio to generate drawables for different screens.This tool provides many things like drawables for ActionBar, Launcher, Tabs icons etc.
http://romannurik.github.io/AndroidAssetStudio/
You can make different size of images and put them in their respected folder to support multiple screens in android.
If you are using eclipse you can see different types of folders in your drawable which support different screens:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
these are respectively used for high, very high and low screen images. You can get more info at:
http://developer.android.com/guide/practices/screens_support.html
Here is some documentation for that: http://developer.android.com/guide/practices/screens_support.html
For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screens, all the different sizes should be:
36x36 (0.75x) for low-density
48x48 (1.0x baseline) for medium-density
72x72 (1.5x) for high-density
96x96 (2.0x) for extra-high-density
180x180 (3.0x) for extra-extra-high-density
Also I recommend "Asset resizer" app for mac, is really useful for get all the sizes from each image.
Related
I've read so much about these things already, so many threads, but there still some things that I don't understand about how to, as a both developer and a designer, avoid problems with different sized screens.
So my question is mainly: What is the difference between putting drawables into mdpi,hdpi,xhdpi,xxhdpi folders as opposed to normal,large,xlarge folders? Should I do both?
I want drawables to act like this: If it takes 50% of the width of the screen on a smartphone, it should take 50% of the screen on a tablet. That's where I'm also confused - Both my phone and tablet are 1920x1080 and both fall into the xhdpi bucket (I believe), but their physical screen sizes are very much different.
Now I save drawables according to the mdpi, hdpi... ratios. Therefore I get results like this on the phone:
When I just out of curiosity created folders for drawables large and xlarge (I didn't know the ratios), I get this, which is closer to what I'm aiming for (but is obviously too big):
But what's the point of using the xhdpi (etc) buckets? Am I understanding this completely wrong? Someone please enlighten me. I hope this question makes sense. My point is - I want the scales of text and pictures to fill about as much of the screen on a tablet as on a smartphone.
Thanks
We developers just create drawbles for mdpi, hdpi, xhdpi, xxhdpi because screen resolution of devices maybe different. While in the case of the normal, large, xlarge folders it is used for the case of screen sizes.We Use This configuration qualifiers (mdpi, hdpi, xhdpi, xxhdpi) because for example for low budget phone, resolution maybe less and will show 48px drawable bigger while high end devices will show it smaller. That's why we create drawables for different resolutions of phones varying from 42(maybe) to 192 px.Similarly normal,large,xlarge folders are used in respect with screen size.
If you want to compress app size, you may use vector drawables. They are just created for one time and look consistent on every time.For Custom icons, export it to .svg or .psd format and create it as vector drawable through android studio.
Edit : I usually create my logo on Photoshop and android studio efficiently exports it to vector drawable.
xlarge screens are at least 960dp x 720dp.
large screens are at least 640dp x 480dp.
normal screens are at least 470dp x 320dp.
small screens are at least 426dp x 320dp.
Vector drawables are put in drawables folder. There is one more advantage of using vector drawables that is one May animate it.
Note : Beginning with Android 3.2 (API level 13), these size groups small, normal, large,xlarge folders are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater use mdpi,hdpi,xhdpi,xxhdpi folders.
The configuration qualifiers (described in detail below) that you can use for density-specific resources are ldpi (low), mdpi (medium), hdpi (high), xhdpi extra-high), xxhdpi (extra-extra-high), and xxxhdpi (extra-extra-extra-high).
Screen Density of devices
A set of six generalized densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
Images Sizes as per folders.
36x36 (0.75x) for low-density
48x48 (1.0x baseline) for medium-density
72x72 (1.5x) for high-density
96x96 (2.0x) for extra-high-density
144x144 (3.0x) for extra-extra-high-density
192x192 (4.0x) for extra-extra-extra-high-density. Hope this will help.You ask me more about this in detail in comments.
So I need to create images to be part of my app that I'm making. I haven't found the answer anywhere.
What I am wondering is...
If I created an image that is to be displayed on Activity1, then what image size in PIXELS should I created the initial image at?
The initial image would then be resized to their corresponding DPI to work well on Android phones.
I may be doing this wrong in creating images so they don't lose their quality, any ideas?
If I am doing this wrong, then please can someone advise on the best practice on creating Android images in pixels and then converting to DPI later after the initial image?
Thank you! :)
EDIT: This question is different because I'm mainly talking about keeping image quality by making the image big first and then downsizing.
You have to create six generalized size image densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
For more detail check out this link
To generate image for Android device you can follow this as I do:
To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8:12:16 scaling ratio between the six generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screens, all the different sizes should be:
36x36 (0.75x) for low-density
48x48 (1.0x baseline) for medium-density
72x72 (1.5x) for high-density
96x96 (2.0x) for extra-high-density
144x144 (3.0x) for extra-extra-high-density
192x192 (4.0x) for extra-extra-extra-high-density (launcher icon
only; see note above)
Or,
Image resolution and DPI are tightly coupled each other. There is a 3:4:6:8 scaling ratio in drawable size by DPI.
LDPI - 0.75x
MDPI - Original size
HDPI - 1.5x
XHDPI - 2.0x
XXHDPI - 3x
XXXHDPI - 4.0x
For example if a 100x100 image is a baseline (MDPI),
LDPI - 75x75
HDPI - 150x150
XHDPI - 200x200
XXHDPI - 300x300
XXXHDPI - 400x400
and so on.
I develop mobile game for Android and my base design is 135x240 pixels. The game itself is pixel art.
How I should multiply core design to get images with the appropriate resolution for the most popular mobile displays?
I know there is standard different screen pixel densities (mdpi, hdpi, xhdpi, xxhdpi, xxxhdpi), but I cannot understand how this will work for my case. Also my game is only in portrait orientation.
Consider your base design as mdpi image, and create others according to the following list:
(0.75x) for low-density
(1.0x baseline) for medium-density
(1.5x) for high-density
(2.0x) for extra-high-density
(3.0x) for extra-extra-high-density
(4.0x) for extra-extra-extra-high-density
Android Export
XXHDPI - 100% baseLine
XHDPI - ?
HDPI - ?
MDPI - ?
LDPI - ?
Plz say anyonce of these sizes
I'm not sure, but don't you need the resolutions of the images?
If so, may I link you to Android Developer support?
You can get a lot of information here:
A set of six generalized densities:
ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi
To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8:12:16 scaling ratio between the six generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screens, all the different sizes should be:
36x36 (0.75x) for low-density
48x48 (1.0x baseline) for medium-density
72x72 (1.5x) for high-density
96x96 (2.0x) for extra-high-density
180x180 (3.0x) for extra-extra-high-density
192x192 (4.0x) for extra-extra-extra-high-density (launcher icon
only; see note above)
Image example:
Now, lets post this, and calculate the rest!
Edit:
I made a simple calculation with Excel
This question already has answers here:
Android splash screen image sizes to fit all devices
(11 answers)
Closed 8 years ago.
I have a background that I need fit in all screen sizes. I have three folders, hdpi, ldpi and mdpi for drawables, but in the emulator there isn't any referense to what resolution hdpi is and what mdpi and ldpi are.
You should read Supporting multiple screens. You must define dpi on your emulator. 240 is hdpi, 160 is mdpi and below that are usually ldpi.
Extract from Android Developer Guide link above:
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
UPDATE: 30.07.2014
If you use Android Studio, make sure you have at least 144x144 resource and than use "FILE-NEW-IMAGE ASSET". Android Studio will make proper image files to all folders for you : )
As documentation says, adjust bitmaps as follows:
Almost every application should have alternative drawable resources for different screen densities, because almost every application has a launcher icon and that icon should look good on all screen densities. Likewise, if you include other bitmap drawables in your application (such as for menu icons or other graphics in your application), you should provide alternative versions or each one, for different densities.
Note: You only need to provide density-specific drawables for bitmap files (.png, .jpg, or .gif) and Nine-Path files (.9.png). If you use XML files to define shapes, colors, or other drawable resources, you should put one copy in the default drawable directory (drawable/).
To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8 scaling ratio between the four generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screen (the size for a launcher icon), all the different sizes should be:
36x36 for low-density (LDPI)
48x48 for medium-density (MDPI)
72x72 for high-density (HDPI)
96x96 for extra high-density (XHDPI)
144x144 for extra extra high-density (XXHDPI)
192x192 for extra extra extra high-density (XXXHDPI)
The documentation is quite sketchy as far as definitive resolutions go. After some research, here's the solution I came to: Android splash screen image sizes to fit all devices
It's basically guided towards splash screens, but it's perfectly applicable to images that should occupy full screen.
Check out this awesome converter. http://labs.rampinteractive.co.uk/android_dp_px_calculator/