I have always issue with screen compatibility, i am creating one layout for all type screen. I am using all 5 type mipmap/drawable for images.
The issue is when i ask to my designer for icons they are asking me for size. i am following below link for all type images
https://developer.android.com/guide/practices/screens_support.html
Still not getting correct icons for all type screens.
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
those size looking big in phones.
It would be very much helpful if anybody can specify the size for different screens.
Thanks
Android Studio gives those features where you can create all 5 different size icons.You need to follow below step:
right click on drawable then >new >Image Asset>
From 2nd image select image option and select your icon from desktop/laptop and android studio will generate all 5 mipmap/drawable type icons.
you can also try with this link
https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
Happy Coding!!
This way you are creating icons with size 48dp x 48dp - they are big. I suppose you want 24dp x 24dp (that is 24px x 24px for medium-density).
Do you know this tool?
https://romannurik.github.io/AndroidAssetStudio/icons-launcher.html
And be sure to put those icons in correct folder...
medium-density in drawable-mdpi, high-density in drawable-hdpi and so on.
The best way to import icon is using image assets:
right click on drawable then >new >Image Asset>the by selecting image type and image location you can easily add icons :)
make sure this should be used in case of icons only
Related
I am creating to show virtual card swipe view for left to right and right to left. so, am trying to give common width & height(xxxhdpi-values dimen.xml) for below mentioned mobiles in Android UI part.
Samsung Galaxy note plus
6.8 inch, 1440*3040 , 498 PPI.
Google Pixel XL3 Android Mobiles.
6.3 inch, 1440w*2960h , 523 ppi density.
both detecting xxxhdpi values folder. so, If I given common width dp values. then, both screen design showing different card UI alignment. UI is not properly fit with the screen in both devices.
so, If I am trying to adjust Samsung device, google pixel design will get collapse/not fit.
so, am thinking, this is the good solution one like I want to create separate values folder for this two devices.
very long back, I have this solution. please find the link below:
How to Create Seperate Values folder Sony Xperia Z1 in android
Ex: I tried for this Samsung: (its detecting in xxxhdpi-values folder(640dpi)).
dp=px/(dpi/160) so, dp = 1440/(640/160)=360 . so, I we got values-sw360dp.
Exactly, I dont know, this method is correct or not, nowadays.
I referred this links also. but, still am not clear idea.
Different values folders in android
How to define dimens.xml for every different screen size in android?
can anyone please help/suggest any alternate/better solution on this UI issue.
It maybe help for more android developers also.
Thanks Advance.
Reference: support different pixel density:
https://developer.android.com/training/multiscreen/screendensities
ldpi Resources for low-density (ldpi) screens (~120dpi).
mdpi Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi Resources for high-density (hdpi) screens (~240dpi).
xhdpi Resources for extra-high-density (xhdpi) screens (~320dpi).
xxhdpi Resources for extra-extra-high-density (xxhdpi) screens (~480dpi).
xxxhdpi Resources for extra-extra-extra-high-density (xxxhdpi) uses (~640dpi).
hi guys i am having a bit of a hard time i have an android application that uses image buttons in the display so far i have been testing on the same device however when i install it on certain devices some of my icons are not visible doe it still occupies the same space and if you click on where they are suppose to be they still trigger their intended actions i am using png images in the recommended dimensions/densities saved in the drawable folders
36x36 for low-density (LDPI)
48x48 for medium-density (MDPI)
72x72 for high-density (HDPI)
96x96 for extra high-density (XHDPI)
180x180 for extra extra high-density (XXHDPI)
192x192 for extra extra extra high-density (XXXHDPI)
plese let me know how to resulv this
use low dimension images
Reason, when rendering image on Screen OpenGLRenderer was not loading bitmap for high resolution devices and hence no image was coming on nexus devices.
please refer :- Android Lollipop not showing android:background image
please let me know if it is dose not work for you.
Hi in the below layout icon displaying small and as well as icons not occupying full screen.I want to occupy the icon in full screen and icon should be in bigger size.!
If I am using small mobiles it occupying full screen and icons also displaying correct size.when I am installing my app in this device it's giving two problems.
Can any one help me from this issues.
Thanks in advance
Check the official documentation for explicit information.
Any android phone has one of this six screen densities.
ldpi Resources for low-density (ldpi) screens (~120dpi).
mdpi Resources for medium-density (mdpi) screens (~160dpi).
(This is the baseline density.)
hdpi Resources for high-density (hdpi) screens (~240dpi).
xhdpi Resources for extra-high-density (xhdpi) screens (~320dpi).
xxhdpi Resources for extra-extra-high-density (xxhdpi) screens (~480dpi).
xxxhdpi Resources for extra-extra-extra-high-density (xxxhdpi) uses (~640dpi).
Use this for the launcher icon only, see note above.
Create icons of different sizes for different screen resolutions and put those icons to yourProject/app/src/main/res/drawable-mdpi or -hdpi or -xhdpi or -xxhdip folder.
I believe the issue here is that even though the tablet has high resolution, it still has low density due to its large screen size. So, the tablet is picking the image from low density folder which makes it look small on large scree.
The discussion here sheds some light on the issue. Basically you are required to create separate drawable folders for tablet's width. Ex. drawable-sw600dp and drawable-sw720dp etc.
Refer developer guide for more details.
I'm completely confused to the core reading various articles to understand to get my app to fit in to different screen sizes. basically the issue i am having is to have a logo fit in to screens with different screen densities. I've got an image with a resolution of 1616x369 which fits in to Nexus 7" tablet and nexus 10" tablets I guess because they contain hdpi screen densities(which looks perfectly fine). but if I change the preview on eclipse to a 10" wxvga screen size which seem to contain an mdpi resolution the image gets pixelated. I know this is because I haven't specified an image in the mdpi folder for android to pick it up, hence it picks up the image from the hdpi folder. What I don't understand is to what resolutions should I create images for mdpi and ldpi folders based on my original image.
I'm not exact sure where I got this information from, but I believe there is a link to it within the Iconography | Android Development documentation.
Density Launcher Action Bar Small/Contextual Notification
mdpi 48x48 px 32x32 px 16x16 px 24x24 px
hdpi 72x72 px 48x48 px 24x24 px 36x36 px
tvdpi (use hdpi) (use hdpi) (use hdpi) (use hdpi)
xhdpi 96x96 px 64x64 px 32x32 px 48x48 px
xxhdpi 144x144 px 96x96 px 48x48 px 72x72 px
The size of the images changes depending what type of image you want.
Launcher icons
Action bar and tab icons
Notification icons
Navigation drawer indicator
Generic icons
Depending of where you will use your image it changes the size, so have the correct set for what you are using.
Then don't forget to copy the image to the folders ldpi, mdpi and so on. If you do this right,you will not get images pixelated.
Just go to this site
http://romannurik.github.io/AndroidAssetStudio/index.html
Click in what type of image you want and generate, select one image for example and download, then you can see the correct sizes. Hope it helps you.
I want to change the color used to indicate a selected radio button. I've found an explanation of how to do so. The only thing I'm missing is a source of images to use. To maintain a consistent appearance I want to take the existing images that are used by default and just recolor them. I've seen a guide explaining to get the images in the past, but when I try searching I'm unable to find it.
You can find the images as part of the SDK:
x:\path\to\SDK\platforms\android-17\data\res\drawable-mdpi
The images from the radio button beginns with btn_radio.
As cafelatte notes you need to provide the 4 differnt densities. There are four types:
ldpi: Resources for low-density (ldpi) screens (~120dpi)
mdpi: Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi: Resources for high-density (hdpi) screens (~240dpi).
xhdpi: Resources for extra high-density (xhdpi) screens (~320dpi).
Either create your own resources, or pull what you need from the SDK.
In ${your-sdk-dir}\platforms\android-${apilevel}\android.jar
Simply take the resources you need from under the res\drawable* subdirectories. Don't forget to provide [l/m/h/x]dpi resources if required.