default resoultion for android launcher icon - android

Android icon guidelines says to use icon of size 36*36pixels for ldpi and 48*48 for mdpi 72*72pixels for hdpi (http://developer.android.com/guide/practices/ui_guidelines/icon_design.html). What is value that i should give as pixels per inch while creating the icon?(Photoshop shows 72 pixels/inch as default value while creating a new icon)

I am quite sure that it does not matter at all. As far as I reckon, the dpi in Photoshop and other (non vectorial) image editing software is used only when you want to print the image.
If you are not convinced, try different settings for your image's dpi and check whether that changes anything.

Related

minimum pixels of the largest image's side to fit android xxhdpi screen

I'm making an android App that shows images at full screen.
I learned some about dpi and dp, but I didn't find how many pixel must be the largest side of my images (in prospective to good fit also in landscape mode) to appear good in different devices.
As in the documentation, the most used screen configurations are normal with hdpi, xhdpi and xxhdpi density:
So, if my thinking is correct, I can make only one image to fit the xxhdpi to works fine also with the other two densities, and put it in Android Studio under the "res/drawable" folder (without qualifier).
Specifying the image size in dp in the layout, Android should scale the image for the smaller configurations.
But, for the xxhdpi, how many pixel must be the largest side of my image, in pixel, to show good?
Edit: how many pixel must be the longest side of my image to be showed properly in a device with xxhdpi density without the image appearing grainy?
All images are photo, not icons, so I can't use the vector graphics.
By looking at the Android Documentation. One can estimate the size of the picture. look at below picture
So, your image resolution should be in similar resolution
LDPI: 200 X 320px
MDPI: 320 X 480px
HDPI: 480 X 800px
XHDPI: 720 X 1280px
XXHDPI: 960 X 1600px
XXXHDPI: 1440 x 2560px
A little bit of +/- won't affect the outcome because with these standard sizes the aspect ratio of any portrait picture should be respected.
Well, if you put the image which fits the xxxhdpi inside the folder drawable, then it will fit all the screens.
But there is another way to use only one image instead of using multiple images for different resolutions. It's by using svg images which are vector images that will not be affected by zoom in or zoom out.
To use svg you need to follow these instructions:
Make the icon to be icon.svg
In the Android Studio, right click on drawable folder
Choose New -> Vector Asset
Choose Local File (SVG, PSD)
Choose your svg file
Click Next and choose the name
Click Finish
In the app build.gradle add the following inside android block:
vectorDrawables {
useSupportLibrary true
}
In the xml layout file, add the following:
<AppCompatImageView
android:width="wrap_content"
android:height="wrap_content"
app:srcCompat="#drawable/your_svg_file"
/>
Android have ratios defined for a image to set in all different drawables
Android icons require five separate sizes for different screen pixel densities. Icons for lower resolution are created automatically from the baseline.
mdpi: 160 dpi 1×
hdpi: 240 dpi 1.5×
xhdpi: 320 dpi 2×
xxhdpi: 480 dpi 3×
xxxhdpi:640 dpi 4×
Above size is for normal pixel icons. There are fix android size for Action bar, Dialog & Tab icons, Launcher icons & Notification icons
Check this link for more details http://iconhandbook.co.uk/reference/chart/android/
You have to take a look at the current market of smartphones.
Here you can see the screen sizes and resolutions of the most popular devices in the market.
http://screensiz.es/
Order the list in pixel per inch and you will see that top smartphones have resolutions bigger than 500 ppi or another way to see it, much bigger than 72ppi of your images.
If you have enough space to store or mechanism to download images try to test with full quality. If thats too much try to find a compromise. Lower image quality and see the result in high resolution screen.
Note that you didn't posted here the total size of image, in case is bigger than screen size, take a look at total size of image and compress it to fit your needs, maintaining as much as possible the resolution.
Edit: Looking only to size of image in pixels, the current biggest screen in smartphone is 2560 x 1440 pixels, so you wont need any image bigger than this.
If I understand your answer correctly, you are talking about images (pictures of lovely cats and dogs?) and not about icons?
I prefer putting images into the nodpi folder.
nodpi Resources for all densities. These are density-independent
resources. The system does not scale resources tagged with this
qualifier, regardless of the current screen's density.
Afterwards I would create a fullscreen ImageView and let imageView do the scaling if needed

App icons for launcher - which drawable sizes are necessary

I offer the ability to change the app icon via a setting... I'm thinking about adding app icons in all material colors (500 + 900 values) which results in 34 icons + 2 for black and white.
Now I'm thinking of adding them only in a few resolutions instead of all. Which one can I safely remove?
I would add:
mdpi
hdpi
xhdpi
xxhdpi
xxxhdpi
Would it work if I only add xxxhpi icons? Or xxxhdpi + hdpi? Which sizes are necessary so that it always works?
EDIT
Why do I want to do this? Just to keep my app as small as possible but having nice icons for all devices
its best to have images in all size of same name,it will take the image based on the resolution of the device

Different sized images (with the same name) in one drawable folder

I'm new to android programming and every single somewhat-similar question is from three or so years ago and doesn't really answer my question. Android Studio used to have different drawable folders for different dpi. Now there is only one. So if I have two images with the same name but for different dpi, where do I add them so that during runtime the phone can use the appropriate image?
Also, most android phones now are xhdpi or xxhdpi--do I really need to include any images less than that? And how exactly would I do that? Say, for example, that I get an image off shutterstock. How do I make it so it works correctly for both xhdpi and xxhdpi?
Those folders have not gone anywhere, if you want them you simply create a new folder and name it appropriately ( drawable-xxhdpi etc.. )
Depending on IDE it just does not make them by default under certain circumstances
DENSITY SIZE LOCATION RATIO SCREEN MARGIN
XXXHDPI 192×192 drawable-xxxhdpi 4 640 DPI 12 to 16 pixels
XXHDPI 144×144 drawable-xxhdpi 3 480 DPI 8 to 12 pixels
XHDPI 96×96 drawable-xhdpi 2 320 DPI 6 to 8 pixels
HDPI 72×72 drawable-hdpi 1.5 240 DPI 4 to 6 pixels
MDPI 48×48 drawable-mdpi 1 160 DPI 3 to 4 pixels
MDPI 48×48 drawable (Cupcake) 1 160 DPI 3 to 4 pixels
LDPI 36×36 drawable-ldpi 0.75 120 DPI 2 to 3 pixels
NA 512×512 Google Play NA NA As required
Android Studio used to have different drawable folders for different dpi.
It still does.
Now there is only one.
No, there are several. However, in the "Android" project view, they are shown in a collapsed state:
If you change the drop-down towards the top-left of that screenshot to "Project", you will get the view that you are used to, that mirrors the filesystem:
So if I have two images with the same name but for different dpi, where do I add them so that during runtime the phone can use the appropriate image?
The same place as before. Personally, I find the "Android" project view to be singularly useless, and so I switch to the "Project" view as one of the first things when I open the project.
most android phones now are xhdpi or xxhdpi
No, right now, only about a third are.
do I really need to include any images less than that?
I would. If you have a zillion drawables, you are welcome to experiment with having fewer densities, but you will want to test the lower densities to confirm that the downsampling of your drawables is turning out OK.
Create the folders yourself as you need them. It's true that most phones now are xhdpi but what about your target audience? Are you sure their phones and tablets support xhdpi at minimum? There are some tablets such as the Galaxy Tab 2 which are below these values. Just something to keep in mind. Although, consider using layout-sw(x)dp for devices bigger than 600dpi
You'll have to resize them for the appropriate drawable. Use you should follow the 3:4:6:8:12:16 scaling ratio where 48x48 is the baseline. As an example, in order to support xxxhdpi your drawables would be 192x192
Actually Android Studio also has multiple drawable folders. But It remains wrapped in Project Structure's Android View.
So you see only one Drawable folder.
If you want to see all the drawable folders in expand mode then click on the drop down like below and select "Project":
Now you can navigate the drawable folders like this:

Can I only set one icon in android for all the dpis?

So im creating a new app and I was wondering if i could only make one icon(technically two but one is 512*512 for the play store). So ill just make a max size icon for xxhdpi will lower res phones scale correctly, or would i actually have to make one for each dpi level. If that is the case, are there any tools that creates the different sizes for me?
You have to make one for each screen density. There are tools available to assist you in this: http://romannurik.github.io/AndroidAssetStudio/index.html
You really have to have an icon for each density value, otherwise you will have a 512*512 icon being used in a ldpi phone, which is very inefficient, as for ldpi phones you should use a 32x32 icon instead. Just use an image editor and resize your original icon or use on-line tools to resize it for you. ynnadkrap has a good example of a tool you can use to get your icons.

how to get same sized launcher icons on different emulator skins…(android)

have a look at figure 2. in the link given below.. http://developer.android.com/guide/practices/screens_support.html..
there it is being mentioned that ,The platform provides density independence to applications by default.(launcher icons are displayed at the same physical sizes, although screen sizes, aspect ratios, and densities are different.)
and showed with 3 emulator screens namely WVGA high density (left), HVGA medium density (center), and QVGA low density (right)...
i have created these 3 avd's and tested but the launcher icons are different in different emulator..can any one knows why it so and how should i get same sized launcher icons on those emulators...
you should refer this:
http://developer.android.com/guide/practices/ui_guidelines/icon_design.html
you have 3 different drawable folder name drawable-mdpi/,drawable-hdpi, drawable-ldpi/ in your res/ folder and each of them have different size icon. if you want same size icon in each emulator then put the same size icon in all three folders.
Keep in mind that your monitor is of a fixed pixel density, while these various devices will have differing pixel density. That means the same number of pixels will be a different physical size on your monitor than it will be on an Android device (which will typically have much smaller pixels than your monitor).

Categories

Resources