Set android screen resolution - android

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.

Related

Android User Interface Scaling

I have a project I am working on where the UI I have developed looks great on a 7" tablet, but the moment I try to use the app on a 10" tablet there is a lot of extra space to the right and bottom of my UI elements. Is there a way to scale UI elements to be bigger based on the size of the screen?
I need the UI to look exactly the same on every resolution possible. It should be noted that I am restricted to Eclipse and am programming on an older version of Android because the utilities I have been supplied with are older utilities.
Wish I could supply a screenshot, but I 100% cannot.
You can use different layouts for different screen sizes.
layout-sw600dp ( for 7 inch tablets)
layout-sw720dp ( for 10 inch tablets)
The system will automatically pick the layout per current device size. Just make sure to have the same layout name and id of the components in the layouts or it might cause exceptions if mismatch is found.
If you want completely different layouts for different sizes ( file names still have to be the same ), you can determine which kind of device it is, you can follow the description in the following's accepted answer.
Determine if the device is a smartphone or tablet?
Now using the above method, you can find appropriate views using IDs or whatever way you prefer without causing exception. I personally just change the dimensions of things and keep the ids same.

Any way to scale my application UI down?

I developed my application specifically for 10" tablets.
I used DP mostly, and some weighting for other elements, however; I'm unable to use an AVD but I have my Nexus 4. The UI looks gigantic on my phone, due to the DP. Is there any way to scale DP without rewriting my code? Some sort of manifest scale?
Thanks.
No. There's no way. I advise you to run the emulator with a big screen (10') and a lower DPI. (QVGA for example), you might find it possible to work with it that way, and it will reflect good the app dimensions.

Can I see in Google Chrome a fluid layout web page in the same way as it is shown in a mobile web browser?

My question assumes I know about the device's resolution and dpi and my monitor resolution and dpi. Also, the web page layout is fluid (everything expressed in percentages of em, as per w3c recommendations).
For example, let's say that in the mobile device I have a screen of 480x320 and a dpi of 192. My monitor has a dpi of 96, does that mean that I should see the same thing as in the mobile browser if I set my desktop's Chrome's dimensions at 960x640? If not, what factors should I account for?
No. You will see the same thing as you will see on the phone if you set chrome's dimensions at 480x320. Pixels are the same no matter whether you are viewing them on a phone, or on a desktop computer.
The DPI figure just tells you the RESOLUTION of the device. e.g. your computer has 96 pixels per inch and your phone has 192. Therefore, 480*320 will take up a bigger physical area on your computer than on your phone screen, although the output will (should be*) exactly the same.
*If you're using any scripts/code which checks for a Useragent and varies the output depending on whether it is a phone/browser/netbook/whatever then you'll need to take this into account. You can get chrome plugins which "spoof" Useragents, allowing you to look at a site as if you are a mobile device. If you're just literally using clever CSS and fluid layouts however you should be fine.
You can change the User-Agent string and emulate different mobile resolutions in the Chrome developer tools.
Open the developer tools with F12, click the gear icon in the lower right corner and open the User agent tab.
There's a difference between hardware pixels and normalized optical pixels, but it's complicated matter. I suggest reading more about it on QuirksMode or A list apart.
Yes you can, Simply Hit Ctrl++ you will see the difference, to zoom out use Ctrl--,
to Come to original State press Ctrl+0.
you can also Resize the window manually, this will change the fluid layout too.

How to set up android emulator for a specific android device

How do I set up emulator for specific android device? I mean how to properly get Abstracted screen density and screen size? Is there any online resource which can provide info about these constants?
Ya, Google it for your answer.
This link here have a few common phones.
See if it matches your needs.
http://mobile.tutsplus.com/tutorials/android/common-android-virtual-device-configurations/
In this wiki page, you can get some resolution and density.
For example, samsung phones:
http://en.wikipedia.org/wiki/List_of_displays_by_pixel_density#Samsung
Yes, it's called Google and math:)
Goole the name of your target device. Get its specs, resolution width and height and screen size. Then the density, which is expressed in dots(pixels) per inch is obtained by simply calculating the total number of pixels for the given screen size and reporting that to one square inch.
At any rate, don't get your hopes high about using the emulator to actually (realistically) simulate real devices. The emulator is slow as hell (to the point where a blank OpenGL surface will be drawn at 2 FPS). Your best bet is to get the actual physical device you need. Second best is to use Android x86 though that one has other issues (but runs generally faster than the default emulator).

Android Eclipse ADT device configuration for EVO 4G 4.3" layout

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.

Categories

Resources