Android custom resolution 1920x1200 - android

I'm building an Android app for Asus Transformer Infinity Pad.
I do not work with the Emulator, but directly with the tablet.
I was working with the maximal possible resolution of 1280x800 (which I've selected from the editor menu) and it looks good both in Eclipse graphical editor and on the tablet itself.
Apparently, I've found that tablet's resolution is HD 1920x1200. As I want to get most of the tablet's resolution, I'd like to work with 1920x1200 both in editor and on tablet.
1. How do I set up a custom resolution of 1920x1200 in Eclipse Graphic Editor (not emulator)?
2. How do I tell the tablet itself to work with 1920x1200 resolution?
Thanks
=====================
OS: Android 4.2.2
SDK: API 17
Tablet: Asus Transformer Infinity Pad TF700T

1. How do I set up a custom resolution of 1900x1200 in Eclipse?
Possible Duplicate:
In Eclipse if you Select the Android SDK and AVD Manager in the Window drop down menu.
You should be able to change the screen size of your Android Virtual
Device (Emulator) there.
2. How do I tell the tablet itself to work with 1900x1200 resolution?
I assume you mean 1920x1200, but I am still not completely sure what you are asking here. The default resolution of the Asus Transformer Infinity Pad TF700T is 1920x1200.
If you did indeed mean 1900x1200, and you want to force the resolution of the TF700T to be 1900x1200 than I am afraid your out of luck. I don't think this is possible, and I don't really see why you want this.
There are a few apps available that can change your screen resolution, if your device is rooted, but I am not sure if the TF700T is supported. Apps such as this one.

Short answer: everything's fine, don't worry about it.
The tablet will pretty much always use the default/native/max resolution. If everything looks good, then don't worry about it. It is using the full resolution anyway. You can't change the graphical layout editor to use custom resolutions as far as I know, so you don't have much choice there (at least for now). It sounds like working with the 1280x800 config gets you close enough that it looks good both in the editor and on the device, so really you don't need to change anything, and there'd be little benefit anyway unless you have some really complex layouts that simply don't fit into the smaller resolution screen (which again, would only be in the editor, the device would use the full resolution).

How do I set up a custom resolution of 1900x1200 in Eclipse?
No need to set any resolution for your eclipse
work with your normal x-large mdpi resolution
let say
x-large-mdpi 1280 x 800 =1
x-large-hdpi 1920 x 1200 =1.5
x-large-xdpi 2560 x 1600 =2
so when you supply graphics for mdpi,hdpi,xhdpi that will work prefectly.
so let design with your normal resolution in your emulator 1280x800
2 How do I tell the tablet itself to work with 1900x1200 resolution?
Google recently released a Device Availability Dialog in the Developer Console that allows you to select the particular device to install. link here
How to restrict android app to specific device make?
if you want only for tablet support you can do like this
<supports-screens
android:smallScreens="false"
android:normalScreens="false"
android:largeScreens="false"
android:xlargeScreens="true"
android:anyDensity="false" />

Related

how to choose an android emulator that match real device

I have created an app that works on 10.1 inch tablet. Later I get a 7 inch one and that need some change to adjust for font size ( font as big as in a big screen and also a smaller screen). Now I get a RedMi note phone that is 5.5 inch. The app looks badly and needs big change of the UI screen. What are the best way to adjust for such changes in screen size and resolution?
Also, how should I create an emulator that meet the real device resolution and screen size? How should I pick when there are no one nexus device that match it completely?
Thanks
Please consider the layout, layout-large, layout-xlarge for making all screen compatibility application.
For example,
layout - Mobile screen
layout-large - Tablet below 7 inch
large-xlarge - Tablet above 7 inch
refer this link for more details http://developer.android.com/guide/practices/screens_support.html
For creating the new emulator device, Goto eclipse and
Window->Android virtual device manager->Device defination(tab)->Select device->Create device-> restart the eclipse
The you can see the created device.

Android Galaxy S4 uses values-large?

Problem:
I am testing my app using the Eclipse/ADT bundle. On an AVD created to emulate the Galaxy S4 (a device defined as being "normal" in size) the OS is selecting the XML files from the values-large folder.
The Android operating system is ignoring all other values folders I have defined in an attempt to differentiate the S4 from tablets.
Given the following folders, it selects the values-large folder for the S4:
values-large
values-sw720dp
values
values-normal-hdpi
values-normal-mdpi
values-normal-xhdpi
values-normal-xxhdpi
values-normal
The problem is that I have Master/Detail (ListFragment/Detail-Fragment) two-fragment display that only displays correctly on large screens (tablets). It does not display correctly on the S4, because of the device's size. On a device smaller than 6" wide, the icons end up getting displayed on top of the text, instead of to the right of the text. The only difference is with the S4 in landscape orientation.
The S4 is the ONLY normal sized device that can show the two-pane layout in landscape orientation. The Nexus 4 and others cannot. In landscape the extra density of the S4 is what makes it work.
I also don't want the S4 to use the dimens.xml file that is in the values-large directory.
Questions:
Is this normal/expected behavior? Does the OS classify the S4 as a "large" device? The OS has ignored every other folder name I have tried to use to target the S4. So, it prefers the pre 3.2 names over the newer ones.
In other words, when I attempt to use the newer folder names, like values-sw720dp, the OS still chooses the large folder.
I have two AVDs. One I created to match the specs of the S4. The other is the Sony Xperia Z1, that has the same specs and is available when you install the Sony SDK. Both AVDs are setup with size=normal. I have checked each to makes certain there is no mistake in their setup.
Thanks.
EDIT
I have a new LG G2, which is similar to the S4 in size and density. It does NOT use the values-large directory. I think it is using values-normal-xxhdpi, but need to run more tests (changing dimension values in the dimens.xml) to see what directory it is choosing.
values-large etc are deprecated with android 3.2 (?). It was replaced with things like values-sw720dp and there is basically not a single device out there running android 3.0 or 3.1. Any device running android 2.x is most likely a medium sized phone.
This means, there is no need of using this old qualifiers.
values-sw720dp means, smallest width = 720dp I doubt, your S4 is that wide.
You should use a qualifier like values-w720dp, which means width = 720dp where width depends on your current orientation.
It's way better than relaying on port or land combination because it shows the two pane layout for large displays having 720dp width in portrait orientation too.
Master/Detail two-pane layout for large screens (any orientation)
That seems fine. The implication is that you will use this for -xlarge as well as -large.
and medium screens with high dpi in landscape orientation
First, I do not know what "medium screens" are, as that term is not used in Android development.
Second, I have no idea why you think this would be appropriate. Screen density should not impact the decision of whether to show one or two panes. I would be interested to know applications, written by experts, you see taking this approach.
At first I thought it was the second folder (sw720dp) causing the problem
Note that you have not stated what the problem is.
The Sony Xperia Z1 AVD
I am not aware that SONY distributes emulator images for their devices.
does the same thing as the S4 AVD
I am not aware that Samsung distributes emulator images for their devices.
Is there a values folder I can use to make the Galaxy S4 not choose Master/Detail at all, but still allow tablets to use it?
Ignoring your "medium screens with high dpi in landscape orientation", use -large or -xlarge for tablets. The Samsung Galaxy S4 will not use -large or -xlarge resources, as it is a -normal device. This was confirmed using both the GT-I9500 and the SGH-I337 versions of this particular model.
Is there a way I can make it use Master/Detail for the S4 only when in landscape?
You can use -normal-land to identify -normal devices in the -land orientation. Note that screen size (-normal) is a bit of a fuzzy match, in that Android considers that valid for devices in that size class or larger. Hence, -normal-land would be used by -large-land and -xlarge-land devices as well, in the absence of better matches.
(Note that density qualifiers are even fuzzier -- -mdpi will be used for any device density, in the absence of a better match, as density qualifiers are designed to be used only on drawable directories, where Android can apply resampling algorithms. Using density qualifiers on anything other than drawables and maybe dimension resources is a code smell.)
Personally, I would not use a dual-pane strategy for -normal-land devices, as -normal goes all the way down to 3" diagonal.
This is all in the Eclipse/ADT bundle using the emulator.
My guess is that this is where your problems are coming in.
Unless you downloaded something from a device manufacturer (e.g., Amazon with their emulator images for the Kindle Fire series), NEVER say that you have a "Sony Xperia Z1 AVD" or a "S4 AVD". You are lying to us and, worse, you are lying to yourself. At best, you have an emulator image that you think that you have configured to match the specifications of those devices. However:
That assumes you got the configuration correct
That assumes that the device manufacturer has not changed the behavior of their device at the firmware level
That assumes there are no emulator bugs
You are certainly welcome to say that you are testing things on -normal -hdpi emulators, or the like, as those are things that you directly control via the Device Definitions tab of the AVD Manager.
After reading your comments, I noticed you said you said the Galaxy S4 screen size you defined was 4.9"? All the specs I've seen say it's 5" which will actually change the size in Device definitions from "normal" to "large" once you correctly set the S4 and Nexus 5 to 5".
Edit the Galaxy S4 emulator's definitions to 5" so you have the right screen size, it will auto-change the size to large, so you will need to decide if you need to switch it to normal then go from there. Also, for those wondering, once that avd starts, it does say that it's pulling from the sw480dp folder, so in your case, you would need a new folder:
values-sw480dp or to eliminate large devices in this bucket, values-normal-sw480dp

How can I emulate an XXHDPI device in Eclipse

I would like to emulate an XXHDPI device in Eclipse. I've updated everything via the SDK manager but there doesn't seem to be the tools available to do this.
Has anyone managed this, or do I need to wait for a further release?
Go to Window --> Android Virtual Device Manager --> Device Definitions --> New...
There you can create a new standard device, which you could per example call Nexus 10.
The size would be xlarge and density xxhdpi.
The screen size (in) 10 inch, and the resolution 2560x1600
Just play around with the rest for a bit, but they shouldn't matter to much for simply emulating the screen itself.
*forgot to put Camera's correctly, but you get the idea.

Preparing apps for the nexus 10

I am working on an android Audio Recording application, our app is currently designed to work on all android phones, the Nexus 7 and the Motorola Xoom tablets.
I was wondering if there are any guidelines or best practices to re-design/modify our app for Nexus 10. More specifically, any pointers on the below points would be really helpful:
UI guidelines to support the new 2560x1600 resolution
Android resource files related modifications (based on similar guidelines)
Any sample or open sources apps that have been modified to work on the nexus 10
Best practices creating and running a nexus 10 emulator since there is no such AVD device by default (screenshot below). Any thoughts on creating one, keeping the high resolution in mind.
As long as you have xhdpi assets, and layouts made for 10" tablets, you shouldn't have to do anything (except add a new xxhdpi launcher icon, as #Mattias mentioned).
To make a Nexus 10 AVD, navigate to Device Definitions:
Then, click New Device. Fill it out something like this:
Now it will be listed in the devices drop-down that you show above.
Regarding your second point, resources:
While the nexus 10 is a xhdpi device, it will use the launcher icon from xxhdpi "one bucket up" if available, so make sure to provide one as it will look much better/clearer/sharper. Reason is that there is room for a bigger icon on this device. Launcher icon size at xxhdpi is 144x144 pixels.
For reference see:
https://plus.google.com/118292708268361843293/posts/ePQya3KsTjW
The best way to emulate the Nexus 10 is to use AndroVM. I am currently running Android on it with the full Nexus 10 2560x1600 resolution and it fits onto my HD screen if I set AndroVM to use 320dpi.
Oh.. and it's VERY fast :-)
I personally use it over emulators and real hardware devices as it's extremely responsive and the deployment of the APK is lightning fast.
I do not contribute to the AndroVM project myself by the way, but it has speeded up my own development cycle considerably. In all development cycles, a developer waiting to see if their code tweaks work using an emulator or a hardware device adds considerable time overhead. I would thoroughly recommend using AndroVM regardless of screen size during normal code development.

Android display differences between WXGA with Nexus 7

I have a Nexus 7 tablet which should have a resolution of 1280px by 800px (WXGA). I develop on Eclipse and my layout is set to display at WXGA. Then, I can place my button and object and choose their size according to what I see on the Eclipse display. The problem is that what I see in Eclipse is very different from the display on the tablet. Everything is much bigger on the tablet and it causes me a lot of troubles.
I wonder if someone have an idea about this?
Edit
For some reason it seems like the 7inch WSVGA is the exact replication of my Nexus 7 screen. It is strange since it offers only 964×544 pixels while the Nexus 7 should give 1280x800
WXGA means nothing by itself. You should look at the density too. Nexus 7 is 213dpi (tvdpi) while a Galaxy Nexus is the same res but 240dpi (hdpi).
You should try to detect the screen size that the Android device has and then run code to re-position screen elements accordingly
In Unity scripting you would get the vars Screen.Width and Screen.Height , I'm not sure what the vars are called in normal android , but you would then set your screen elements to react to what ever size the screen it .

Categories

Resources