I'm trying to create an ADT layout configuration to match an EVO 4G screen, with its 800x480 resolution and 4.3" screen. The emulator I created by just specifying WVGA800 in the SDK Manager seems to match my physical EVO device perfectly.
However, when I try to create a Layout device config (the one you select when you edit an XML view), I can't match it at all, no matter the values I've tried so far. The default configuration only includes a 3.7" and then jumps to 5.1" (whaaa, why did ADT devs think 4.3" screens weren't important enough?). OK, so I make a custom one, but no matter what values I try, I can't match the emulator size.
Does anyone know what the exact values I must put in to the layout config for it to match 100%? x dpi, y dpi? Values I found online end up not matching the right size. It looks like the Density needs to be set to High, and Screen Ratio and Screen Size don't matter.
Thank you.
Artem - I have the same phone, and the same problem as you. I played around a bit, and I found that setting the x and y dpis to 250 is a pretty good match (with dpi set to "high density"). I doubt it is 100%, but it is close enough for me for now.
If anyone else has found a better value, please post it.
Related
In my app, I support multiple screens to a reasonable extent as per the guidelines here and here. However, the S8+ seems to be taking the layout-normal layout instead of layout-large. I remember reading that it could be due to its odd aspect ratio (18.5:9) when its setting for "use fullscreen" or something is enabled. It seems with or without this setting the result is the same (uses normal layout). I suspect there are other phones that will have this issue.
Also, interestingly, I made a generic device definition in Android Studio of that phone, with it's 2960x1440, 6.2" screen to preview the screen and Android automatically reclassified it as a tablet (and forces it to use the large layout in the preview). This leads me to believe that it would do the same at runtime on a device, but it would appear it doesn't.
How can I set my app to have these phones (perhaps those with these...problematic...aspect ratios) use the large layout it was supposed to?
As mentioned in the comment by #CommonsWare, it would be better to use dp size qualifiers, however to shed a little light on why your problem happens:
The old size qualifiers are size "buckets", they represent a range of sizes and aren't very precise. So the S8+ falls into the normal size bucket on the device (probably due to the size the device is reporting), but large on the emulator (which seems suspect to me).
If you look closely at the resource qualifier definitions listed here Providing Resources you will notice the definitions for screen size are a bit vague.. taking a unit dp to be 1/160 inch.. the screen sizes they describe are "approximately":
small: 2" x 2.6"
medium: 2" x 2.9"
large: 3" x 4"
xlarge: 4.5" x 6"
Note that all of these sizes are surprisingly small. In reality the device manufacturer decides the bucket it falls into, which is very likely why your S8+ reports "normal" and the emulator is a tablet.. by the table above, it would be.
Essentially I recommend you use the "smallest width" qualifier. You can find some hints around the values you might want on the same page linked above.
I have created 3 Device Descriptions that mimic the latest models of Samsung mobile devices (S2, S3 & S4). Although I enter the diagonal screen length and pixels (w x h), I am unable to see a change in density across the 3 AVDs when I start them using the AVD Manager (screen caps below). Did I miss something or does the tool support density changes? Also, this is poorly documented.
After a quit and re-enter, things worked fine but the density value never updated, always reads 320 - probably based on my laptops screen. Also DON'T use option 'Scale display to real size". Let the emulator do the rendering and move app to device for native testing.
I have layout xml files for default, default-land, sw480dp, sw480dp-land,sw600dp, and sw600dp-land in an Android project I'm working on. All emulator's scale my resources correctly except for the 4.65" and 4.7" emulators in Eclipse, and does not scale the ad space, or my buttons correctly. These emulators seem to be pulling my default layout resources, but the scaling is wayyy off, and I am not sure why this is. I've tried adding a new folder for sw720dp, but this pulls up the 10" tablet emulator, and does not allow the 4.65 or 4.7 inch devices. Can anyone give me some clues as to what might be going wrong here? I'm done with all my functionality, and was just testing out all devices before submitting the app, and now I've hit a road block. Thanks!
P.S
Not sure what kind of info you'd need to help me out with this, code wise, so let me know what might help you, and I'll insert it!
I would like to test my app-layout with different resolutions. Therfore I created an emulator-device with a resolution of 480x832 (the same as my motorola droid/milestone).
I did all my layout_width with "fill_parent" or with dp - but what looks good on the device (e.g. filling up the whole width) is much too small in the emulator. fill_parent works, but layouts with dp are a lot different.
What am I doing wrong?
Thanks a lot!
As Asahi pointed out in the comments, the density of the screen is also important. You should set that to 240, the density of the Droid. However, it is hard to emulate a phone screen exactly on a monitor because the monitor has a much lower pixel density. Therefore, your emulator will look very large in comparison to the actual device.
This article goes into more details on handling multiple screen sizes in the emulator.
I'm trying to alter the default screen resolution of the Android emulator (and by extension, the Android device) to work at 1700x1200. In other words, I need the screen to be able to display unique points over that range.
I have set the dimensions in my layout file, yet the device still defaults to 320x480. I've set different dpi densities, but to no avail.
Any help would be great, even just a direction to explore.
EDIT: Thanks for the two responses. I guess my question wasn't clear - I understand that the top resolution for the device is fixed, but I need to scale the screen to display with finer granularity than just 640X850 (which I believe is the highest resolution). I understand you can set dpi density from 120-240, but I need to know how to set the scaling functionality to simulate a screen of 1700x1200. My guess is that it will have to be done by my code, but I would prefer for the platform to auto-scale it down for me. This may not be possible, but I just wanted to check.
Using Android SDK 2.0 or 2.1 you can create an AVD with a custom resolution. If you want you can also run the emulator with the -skin argument, for instance emulator -skin 1700x1200 and you'll get what you want.
May be i'm not completely understand that. You want physical device such as ADP1 phone for example, to have 1700x1200 ? If it that you want - i have some bad news - if you look at any device spec you'll see resolution listed. It's there because it characteristic of physical screen. It can't be changed.