What's the right size for an Image Asset? - java

I have a picture and want to use it as the app icon for my android app. I use the ImageAsset in Android Studio to create multiple icons for different phones, so I only need one picture.
My picture turned out too small (144px x 144px) and I cannot find information about the sizes on the developer pages.
Who can help me with this question?

"512 x 512 pixel image [is] appropriate for the Google Play store"
To start Image Asset Studio, follow these steps:
In the Project window, select the Android view.
Right-click the res folder and select New > Image Asset.
Continue by following the steps to:
If your app supports Android 8.0, create adaptive and legacy launcher icons.
If your app supports versions no higher than Android 7.1, create a legacy launcher icon only.
Create an action bar or tab icon.
Create a notification icon.
for more detail

Use App Icon Creater from Android Studio. Go to File -> New -> Image Asset and select Launcher Icons

1/ The suitable place to but app launcher icons is mipmap folder, not drawable like other images. According to this answer, images in the mipmap folder use different resolutions from the device’s current density.
My ic_launcher in mipmap-xxhdpi is also 144x144 but it still looks good on my device
2/ Check your source image when creating an app logo with Image Asset tools. Use a high-resolution image for better result. I used a 512x512 image

I would create separate images for each one:
LDPI should be 36 x 36.
MDPI should be 48 x 48.
TVDPI should be 64 x 64.
HDPI should be 72 x 72.
XHDPI should be 96 x 96.
XXHDPI should be 144 x 144.
XXXHDPI should be 192 x 192.
Then just put each of them in the separate stalks of the drawable folder.
You are also required to give a large version of your icon when uploading your app onto the Google Play Store and this should be WEB 512 x 512. This is so large so that Google can rescale it to any size in order to advertise your app throughout the Google Play Store and not add pixelation to your logo.
Basically, all of the other icons should be in proportion to the 'baseline' icon, MDPI at 48 x 48.
LDPI is MDPI x 0.75.
TVDPI is MDPI x 1.33.
HDPI is MDPI x 1.5.
XHDPI is MDPI x 2.
XXHDPI is MDPI x 3.
XXXHDPI is MDPI x 4.
This is all explained on the Iconography page of the Android Developers website:
http://developer.android.com/design/style/iconography.html

196 is a right side of android icon,create 196 icon side and create multiple images.

Related

Android Studio Drawables not working

I'm trying to create an app where the header fits the entire width of the screen. I've got a Samsung Galaxy S8 Plus with a density of XXXHDPI according to Google's Device Metrics yet when I create an assets folder inside the 'res' folder named 'drawable-xxxhdpi' it doesn't load accordingly and fit the screen. Why is this? I've also tried putting it in the XHDPI and XXHDPI incase it scaled up but no. There's always a white space where the image is not scaling up.
The drawables folder has been created correctly and the XXHDPI works fine for XXHDPI devices but doesn't for bigger screens.
The white space on the right when testing on a bigger device
drawable and assets are independent directories . To load Drawable from asets you need to use Drawable.createFromStream().
Drawable d = Drawable.createFromStream(getAssets().open("images/sky.png"), null);
Other than that just make the hierarchy right and use it in conventional way. asset should be parallel to res not inside res.
Asset should be used to additional pre-bundled files not for images. because if you do this you can not provide multiple screen support.
So create Assets inside app/src/main/assets/.
And drawable inside res.
You might wanna check out these links Where should put Assets and Where should put Drawables.

Android Wear screen sizes

At present the resolution of Android wear devices is:
280x280 or
320x320
Does anyone know if you should have graphics for both the screen sizes and place them under the hdpi and xhdpi folders?
Also is there a way to auto scale down your images from 320x320 so that they work on a 280x280 device?
Thanks!
hdpi should be all that you need, all watches are a hdpi density
I would create background images at 320x320 and android will automatically scale them down to 280x280 if needed.
You will need to watch out for round devices, as they are 320x320 but the corners will be cut off

Support all android screen size

I'm have tired to support all android , but I want to ask about supporting all screen size on android
I have 4 layout folders :
layout
layout-ldpi 2.7 inch = 240*320
layout-mdpi 3.2 = 320*480
layout-hdpi 3.7 = 480*800
layout-xhdpi 800*1280
layout-xxhdpi 5 inch 1080*1920
Is this setting in each layout support all devices or maybe I have missed some thing ?
Note : I have reviewed android site Android Developers many time .
I'm not sure what you want to achieve. You should split your resoures in two groups. One with density (folder called drawable) which contains images in different sizes for different display resolutions. The second one with layout (called layout) is for supporting different UI layout of each screen. Typically for tablet or mobile phones. So you should have forlder
drawable-ldpi, mdpi, etc. - here will be your png files
layout-"default",sw360, sw600, sw720 ("large" mobile, small 7" tablet, large 10" tablet). If your are targeting below 3.2, you can't you sw (smallest-width) but use older small, medium, large, xlarge screen size. - here will be your *.xml layout files
Don't mix up layout and density resource qualifiers together. See more here

Android screen size and density. How to choose text size?

I'm trying to understand multi-screen support in android. Yes I read the documentation, but still have few questions.
As I understand i need to create drawables for each density, but what to do with text size?
I want to set title on my activity which will fit any screen (need to big big enough and don't warp the text)
I test in on my Nexus7 (large screen) and it looks good with android:textSize="100dp"'
When i launch it on emulator with 'normal screen' size i get very big text.
So is it right solution to make layouts for each screen size?
'layout'
'layout-large'
'layout-small'
....
and just make android:textSize="70dp" for normal screen and android:textSize="50dp" for small screen?
And another one question how to test all this in more efficient way?
I need to create emulators with? Where to get parameters with which create emulators to get this results?
XLarge screen
ldpi
mdpi
tvdpi
hdpi
xhdpi
Large screen
ldpi
mdpi
tvdpi
hdpi
xhdpi
Medium screen
ldpi
mdpi
tvdpi
hdpi
xhdpi
Small screen
ldpi
mdpi
tvdpi
hdpi
xhdpi
For text size you should use sp units. Docs say:
Scale-independent Pixels - This is like the dp unit, but it is also
scaled by the user's font size preference. It is recommend you use
this unit when specifying font sizes, so they will be adjusted for
both the screen density and the user's preference.
As I understand i need to create drawables for each density, but what to do with text size?
As WebnetMobile indicates, you start by using sp, as this takes the user's choice of font scale into account. However, you may need more than that.
So is it right solution to make layouts for each screen size?
I would recommend using dimension resources, with different definitions for the text size dimension as needed for your different scenarios.
Where possible, though, design your UI to be more flexible about font sizes. Again, if you use sp, the user can change the size of the text on Android 4.0+, to make it bigger or smaller, to help them read the text on their device. Hence, you cannot assume that you are in complete control over the size of the font, and therefore need to design accordingly. This is not significantly different than designing a Web site that takes into account users' adjustments to font size in their browser.
And another one question how to test all this in more efficient way? I need to create emulators with?
You will need emulators or devices for whatever scenarios concern you.
Where to get parameters with which create emulators to get this results?
On the (now-current) R21 versions of the tools, you set the screen size and density in the Device Definitions tab of the AVD Manager, then create AVDs based upon those definitions as needed.
Inorder to test in different screens and density you can create emulators with different combinations. When we create the emulator device we can set the Density (Abstracted LCD density under hardware).
ldpi - 120
mdpi - 160
hdpi - 240
xhdpi - 320
You can set the screen size also while start the emulator

Having trouble getting my head around UI Graphics android

At the moment I have just targeted my UI graphics for the hdpi resolutions for android and this works flawlessly, the graphics are designed with 3 resolutions in mind with only the background image being altered really. Problem is the plan was to use the same images for hdpi (480x800 and 480x854) and as well as mdpi (320x480). But when I test it for mdpi with the images in both the -hdpi and copied into -mdpi it doesn't scale them down, do I have to resize all the images and have them duplicated for the mdpi screens?
Sorry if this is not very eloquent it is the first time I have done any UI design for android and still don't understand it properly.
Android should correctly use the right image when you use R.drawable and your images are in drawable-hdpi, drawable-mdpi etc. Since that is what I think you've described as what you've done, it hints that maybe you've hardcoded a size? Are you using ImageView and set a size for them? If so, did you do it in Java code or in XML? If in Java code the values would be in pixels, so 50px on mdpi screens will look larger than on hdpi screens. If you used XML did you again set a size with px? If so, you should use dp.

Categories

Resources