Question about using dimens.xml - Java for Android App Development

I want to adjust my app for different screen sizes, So i created a dimens file for small screens
and created values-h470dp folder for bigger screens. For some reason, on the emulator the nexus 5 choose the dimens values of the small screen. The resolution of nexus 5 is 1080 x 1920 pixels and the density is 445 ppi pixel so the height should be 1920 * (160/445) = 690dp. So why is nexus 5 use the small screen dimens while its height is larger than 470dp?

Related

Panel Dimensions

Hi,
The Xperia screen resolution is 800x480. Yet I remember reading somewhere that the panel thumbnail was 400 something by 200 something pixels.
So if I am developing icons for a panel do I go with the 800x480 resolution or the 400 by something?
Can someone please let me know what dimensions need to be used for portrait as well as landscape mode.
Thanks!
You will need:
400 x 180 Landscape pic
200 x 120 Landscape pic
240 x 350 Portrait pic
120 x 175 Portrait pic
Can someone explain the difference...as to why the resolution is 800x480 but the panel size is 400x180?
So any icons I design, I need to make sure they fit within 400x180 for the landscape mode?
Erum said:
Can someone explain the difference...as to why the resolution is 800x480 but the panel size is 400x180?
So any icons I design, I need to make sure they fit within 400x180 for the landscape mode?
Click to expand...
Click to collapse
I can only guess that they are smaller because they only work as a preview and probably loads faster.
But if that is the case then it is still debatable as to what size the icons needs to be as that is the actual panel graphics not thumbnails.
I was going thru the documentation and they mention something about double pixeling. And say something like make the icons the right size but state the width and height as half. I'll see if I can find where I read that bit so I can copy/paste the exact thing.
So right now I'm just as confused.

android wallpapers - wtf?

I never really worked this out on my phone either, but how do you actually set a wallpaper that fits decenty and isnt over zoomed?
I have tried zedge,gallery,hd wallpapers and never really managed consistent results.
Thanks
Android wallpapers are as follows
Hold the device in portrait. The wallpaper will be:
Width: Pixels Across Screen x 2
Height: Same
So if my phone resolution was 480x800, I would need wallpapers that were 960x800 to fit properly. On the vega the resolution is 600x1024 and so you need images that are 1200x1024 to fit properly.

Difference between dencity and resolution?

How are these different
If we change dencity of android phone so is resolution will be the same?
Resolution of a display is the total number of pixels that the display contains.
The actual hardware density is constant, but the density that is presented to the software can be changed.
If a program needs to display something that needs to look a certain height, and the reported display density is 160 ppi, the program will use 16 pixels, but if the reported density is 200, that tells the program that the pixels are smaller, and it will use 20 pixels to present the same object. However, since the resolution is unchanged, the object will actually look bigger.
I hope that clears it up for you.
Thnkss a lot
And changing Density is certainly usefull for new High Resolution Devices that Cant Operate old apps fullscreen...
Changing means it should be kept to high,so that every object looks smaller and really becomes to look like high quality.:thumbup:

About supporting multiple screen.

Hi,
About support for multiple screens , I have understood to be based on the dpi , screen density .
As I read there are 4 types of density in android devices, approximately:
low - 120 dpi
medium - 160 dpi
high - 240 dpi
xhigh - 320 dpi
Also, I would have to define everything that uses , in my application, ' dp ' rather than pixels , okey .
Now what?
Different screen sizes , with different densities .
Put yourself in the situation that I want to make a game and I want to start by making a background and sprite.
It would have to do 4 sprites and 4 different funds for different types of densities, ok ? But, who would actually scale ? I mean, to work in any image editor like photoshop.
That dimension should have , for example , the background ?
I'll start with the high density ( 240dpi ) .
I have three devices with different sizes but same density.
The first is of 480x800 , 320x480 second and third 768x1280 .
Well, for example , to make the background of the game , that dimension would have to have ? A be the average of the three ? 784x1280 ?
If this is true, now would have to convert the pixels in pd to have an intermediate dimension depending on the dpi and I can work with , using the formula p = dp * ( dpi/160 ), where 'p' are pixels, 'dp' density-independent pixels, and dpi are dpi
And I would have , rounding , 523dp x 854dp .
This would be my size in pixels with which would make my background in photoshop.
All this is correct ? If I make a real background with dimensions 523x854 pixels , which conventiran in ' dp ' in the android devices, will look good on all those screens whose density is high ?
Please, correct me and help me
Thanks
PD: Sorry for my english, I used translate google
Pryato said:
Hi,
About support for multiple screens , I have understood to be based on the dpi , screen density .
As I read there are 4 types of density in android devices, approximately:
low - 120 dpi
medium - 160 dpi
high - 240 dpi
xhigh - 320 dpi
Also, I would have to define everything that uses , in my application, ' dp ' rather than pixels , okey .
Now what?
Different screen sizes , with different densities .
Put yourself in the situation that I want to make a game and I want to start by making a background and sprite.
It would have to do 4 sprites and 4 different funds for different types of densities, ok ? But, who would actually scale ? I mean, to work in any image editor like photoshop.
That dimension should have , for example , the background ?
I'll start with the high density ( 240dpi ) .
I have three devices with different sizes but same density.
The first is of 480x800 , 320x480 second and third 768x1280 .
Well, for example , to make the background of the game , that dimension would have to have ? A be the average of the three ? 784x1280 ?
If this is true, now would have to convert the pixels in pd to have an intermediate dimension depending on the dpi and I can work with , using the formula p = dp * ( dpi/160 ), where 'p' are pixels, 'dp' density-independent pixels, and dpi are dpi
And I would have , rounding , 523dp x 854dp .
This would be my size in pixels with which would make my background in photoshop.
All this is correct ? If I make a real background with dimensions 523x854 pixels , which conventiran in ' dp ' in the android devices, will look good on all those screens whose density is high ?
Please, correct me and help me
Thanks
PD: Sorry for my english, I used translate google
Click to expand...
Click to collapse
Make 5 folders in res folder
drawable-ldpi
drawable-mdpi
drawable-hdpi
drawable-xhdpi
drawable-xxhdpi
and put every thing on them and andrioid resize them automatically.
also...for best results use "wrap_content"
in layout_width and layout_height
Pryato said:
Hi,
About support for multiple screens , I have understood to be based on the dpi , screen density .
As I read there are 4 types of density in android devices, approximately:
low - 120 dpi
medium - 160 dpi
high - 240 dpi
xhigh - 320 dpi
Also, I would have to define everything that uses , in my application, ' dp ' rather than pixels , okey .
Now what?
Different screen sizes , with different densities .
Put yourself in the situation that I want to make a game and I want to start by making a background and sprite.
It would have to do 4 sprites and 4 different funds for different types of densities, ok ? But, who would actually scale ? I mean, to work in any image editor like photoshop.
That dimension should have , for example , the background ?
I'll start with the high density ( 240dpi ) .
I have three devices with different sizes but same density.
The first is of 480x800 , 320x480 second and third 768x1280 .
Well, for example , to make the background of the game , that dimension would have to have ? A be the average of the three ? 784x1280 ?
If this is true, now would have to convert the pixels in pd to have an intermediate dimension depending on the dpi and I can work with , using the formula p = dp * ( dpi/160 ), where 'p' are pixels, 'dp' density-independent pixels, and dpi are dpi
And I would have , rounding , 523dp x 854dp .
This would be my size in pixels with which would make my background in photoshop.
All this is correct ? If I make a real background with dimensions 523x854 pixels , which conventiran in ' dp ' in the android devices, will look good on all those screens whose density is high ?
Please, correct me and help me
Thanks
PD: Sorry for my english, I used translate google
Click to expand...
Click to collapse
Just make one image of xxhdpi dimensions and resize it using Google android asset studio
Sent from my GT-S5570 using XDA Premium 4 mobile app
arpitkh96 said:
Just make one image of xxhdpi dimensions and resize it using Google android asset studio
Sent from my GT-S5570 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
No need to resize manually. Android itself resize them
Sent from my GT-S5360 using Tapatalk 2
mohamedrashad said:
No need to resize manually. Android itself resize them
Sent from my GT-S5360 using Tapatalk 2
Click to expand...
Click to collapse
Yeah but it would cause more resource consumption
Sent from my GT-S5570 using XDA Premium 4 mobile app
Thanks to all
Bitmap decodeStream by multiple screen. Only need one picture
You should also include a drawable-xxxhdpi folder. This is only required for 1080p devices with the KitKat launcher, and only the app icon is needed here, it should have a resolution of 192 x 192 pixels.
andras_k said:
You should also include a drawable-xxxhdpi folder. This is only required for 1080p devices with the KitKat launcher, and only the app icon is needed here, it should have a resolution of 192 x 192 pixels.
Click to expand...
Click to collapse
Thanks, I will do it

Setting wallapers

I've notice when setting 1440 x 2560 images it seems to zom on the image ever so slightly once set .Is there a reason why it doesn't set the full image as wallpaper ?
combat goofwing said:
I've notice when setting 1440 x 2560 images it seems to zom on the image ever so slightly once set .Is there a reason why it doesn't set the full image as wallpaper ?
Click to expand...
Click to collapse
It is because the launcher, if you want to set a full 1440X2560, I recommend using Wallpaper Changer and pick Fit.
I'm finding even some 1440x 2560 images are being cropped,I see some lively pics on line but when set as wallpapers don't look the same,they have been cropped etc ,what is the optimal resolution to set as wallpaper

Categories

Resources