I have question regarding Android Layouts.I have read the documentation of Layouts .My question is that while developing lets say if the images are placed in the folders named
drawable-hdpi
drawable-ldpi
drawable-mdpi
drawable-xhdpi
Does drawable-ldpi refers to the phones with smaller screen ,drawable-xhdpi for tabs and drawable-mdpi medium sized screen phones.
If not i have a image i need to be able to put into all types of devices namingly phone,tab
How can i do it.
usually, larger screens have higher DPIs, but that is not always the case. if you are trying to differentiate between phone and tablet screens, density is not the right way. use the following,
drawable: phones
drawable-sw600dp: 7" tablets
drawable-sw720dp: 10" tablets
alternatively, you can use the screen size: small, medium, large, xlarge. e.g., drawable-large. from the docs,
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
http://developer.android.com/guide/practices/screens_support.html
Googling Android xhdpi brings up the Android resource on how you should use these:
http://developer.android.com/guide/practices/screens_support.html
DPI means how many dots per inch there are. Some small phones fit lots of dots in, which gives them a high DPI. You should provide different sized images for different resolutions. Google recommends creating images in the ration of 3:4:6:8 for l, m, h and xh DPIs.
Related
Based on this dashboard https://developer.android.com/about/dashboards/:
92% of Android devices are "Normal size with hdpi-xxhdpi density"
Unfortunately that info does not help to understand what the approximate resolution of those devices.
As I was digging through different sites to understand the concept of screen size and density I have found following concept:
normal screens are at least 470dp x 320dp
large screens are at least 640dp x 480dp
xlarge screens are at least 960dp x 720dp
As xxxhdpi refers to x4 scale I expect something like:
Normal screen with xxhdpi density will be < 1880x1280 pixels (typical 1920x1080?)
Large screen with xxhdpi density will be < 2560x1920 pixels (typical 2560x1440)
But then I found this table -https://material.io/tools/devices/
And it does not fit at all. For example:
Samsung Galaxy Note 4 - 5,7" 1440x2560 (515dpi) - xxhdpi (x3)
Nexus 6P - 5,7" 1440x2560 (515dpi) - xxxhdpi (x3.5)
As you can see, devices with identical screens goes to different buckets.
Can anyone tell what is wrong with my assumptions?
The reason I need this is because I developed a game for Android and I want to optimize it. My reference resolution for art is 2732 x 2048 (the largest for mobile devices). I want to build separate APK for usual 1920x1080 and lower resolution, so it will save disk space and RAM on user device.
While building android apps, it's important to know the DPI (Dots Per Inch) value, but in case you are not sure about the mobile device the user is using, the dpi may vary and hence, the concept of PPI (Pixel Per Inch) comes into play.
The problem with your assumption is that while considering PPI and DPI, always leave DPI and select PPI cause it will give you an accurate result. Both the phones have a different PPI and hence, the xxxhdpi goes up in case of Nexus6P as compared to xxhdpi Note 4
XXXHDPI= Extra Extra Extra High Dots Per square inch.
XXHDPI= Extra Extra High Dots Per Square inch.
Note that one 'extra' in their full form.
drawable-xxhdpi, 480 PPI (3 x 160 PPI)
drawable-xxxhdpi, 640 PPI (4 x 160 PPI)
As you can see the PPI varies and hence, Nexus 6P has PPI somewhere between that range.
We have a mobile application using webview and HTML, CSS, jQuery. The application was first developed for Samsung Galaxy Mini as its pilot platform and now it is intended to provide a decent UI in all Android phones and tablets.
The application layout is simple - 1 column, and we do not want to change the design layout -the number of columns. We will create different layouts in photoshop, but what should be the psd sizes to cover normal, large, and extra-large window sizes? Any help will be greatly appreciated.
Thank you.
https://developer.android.com/guide/practices/screens_support.html
for best Design :-
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
I have an app that I am creating. I want to have this app support tablets, so I created a folder in my res: res/layout-xlarge/my_layout.xml. However, when I run my app on a tablet (defined as 7" or above) the layouts are not used from the layout-xlarge folder, but instead from the layout folder.
I then discovered that there were also layout-large layouts that I could use too. I haven't yet tried them, but I will.
I would like to know what is the difference between layout files, layout-large files and layout-xlarge files. Which one would be the best to use for tablet layouts?
Thanks!
From Android documentation - Supporting Multiple Screens:
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
Which one to use, as you can see, depends on the dimensions of the device you're aiming for. You probably want to build your app so it will support as much devices as possible.
In Android we need to maintain different folders for the layouts with different resolution reason behind it is the use or the resolution of the Android Device on which the application gonna execute.
small Resources for small size screens.
normal Resources for normal size screens. (This is the baseline size.)
large Resources for large size screens.
xlarge Resources for extra large size screens.
Android OS select the specific layout it self by checking the compatible device and its resolution.
So, better to create folders to support in multiple screens
I'm a bit confused and i hope you can help me. I'm developing an application for smartphones and i'm using prefixes like: mdpi, hdpi and xhpi. With first two i don't have any problems.
According to this:
http://developer.android.com/guide/practices/screens_support.html
and this
http://developer.android.com/about/dashboards/index.html
xhdpi is 640x960 px screen size and I have prepared my graphics for this resolution. But I can't find any device with this resolution. Instead of this, in android layout editor I have, for example, Galaxy Nexus which is marked as xhdpi device, but it has 720p screen size.
So my question is, I should look at this tables from documentation and believe that 25% devices has screen of size 640x960 px or I should change my graphics to the 720p screen size ?
If you develop only for phones and tablets for you is unnecessary you may not use xhdpi folder for your resources. If you want that your app works fine on modern devices such as Galaxy Nexus, Nuxus 4, etc you should support xhdpi screens.
large screens are at least 640dp x 480dp (hdpi)
xlarge screens are at least 960dp x 720dp (xhdpi)
So I have two sets of layout, one for a 7inch tablet, one for a 10 inch tablet.
Configuration.SCREENLAYOUT_SIZE_MASK
shows large for the 7, xlarge for the 10 device. I created two folders, layout-large and layout-xlarge, but the 7inch device uses the x-large layouts (I even deleted the normal layout folder).
What could be my problem here?
EDIT: I also tried the new qualifiers according to http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts, making the layout folder for the 10"
layoutw1280dp
which the 7" cannot possiblys have, still the same.
Don't underestimate how many pixels these small screens can have. The Samsung Galaxy S3 has 720x1280 screen. That screen couldn't be larger than 7"
From the documentation:
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
Which tablet is it?
Sorry bothering you guys, obviously it was not an Android problem, but an Eclipse one, somehow the layout files within the folders got mixed up when I imported the project.