i developed an android appplication. and i want to test this application for xlarge screens.
when i tried to create an emulator with the following resolutions the emulators are not loading
is there any way to test the application for xlarge screens
I tried with the following resolutions:
hdpi-
1536x1152
1920x1152
1920x1200
xhdpi-
2048x1536
2560x1536
2560x1600
my monitor is Dell-21" with resolution Max-1600*900.
There are specific Android API calls that can, at runtime tell you what density and (small/large/normal) screen size a handset has. However, as a developer we should not need to worry about individual handsets at all. All we need to do is to have ldpi/mdpi/hdpi assets and small/normal/large layouts in the apk. Android internally handles everything.
Dont forget to get an indepth understanding of how Android determines which assets to use and aliasing like this.
The definitions are:
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. (Android does not currently support screens smaller than this.)
Here are some more examples of how this works with real screens:
A QVGA screen is 320x240 ldpi. Converting to mdpi (a 4/3 scaling factor) gives us 426dp x 320dp; this matches the minimum size above for the small screen bucket.
The Xoom is a typical 10” tablet with a 1280x800 mdpi screen. This places it into the xlarge screen bucket.
The Dell Streak is a 800x480 mdpi screen. This places it into the bottom of the large size bucket.
A typical 7” tablet has a 1024x600 mdpi screen. This also counts as a large screen.
i want to test this application for xlarge screens. when i tried to
create an emulator with the following resolutions the emulators are
not loading is there any way to test the application for xlarge
screens
AFAIK you can Only create Emulator With Given Below suggestions with Density
While Creating AVD you will get Below Image. you can only choose from the Below Devices to make your Emulator.
Your Alternative Solution :
However, I need to ensure everything's fine.
Yes you can Surely get what you want.
if you want to Check whether your application runs perfectly on 960x640(Normal screen xhdpi) Device. you can Make Custom Configuration From Below Suggestion.
After Update your ADT to version 21.
In Older Version each time you have to set Add Custom Screen if you want custom Device Configurations as (if you want Nexus 4).
In ADT21 version you can get this thing done by
open AVD Manager, u can define your custom screen in "Device Definition"
Alternative (Much Easier approach)
in Newest Version you Don't Need to Set Custom Device
Configurations from the above Suggestion as much easier way is available for it. you >Just Have to Make Emulator With your Device
Configurations and after you will see those Configurations with
Emulator Name Inside Graphical Layout of XML
like after Created my Emulator of Nexus7 Emulator with Android 4.2 with Name as "Nexus7_Android_4.2" i will get this Device Configuration in Graphical Layout of xml automatically.
Below is the Screen Shot of it.
Hope it will Help you.
In emulator ie in AVD->Device Definition.You can select and fix any type of resolution. You
can also customise any type of size. Since it takes time to load due to high resolution in
emulator.
Related
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
am developing an application which support from 2.3.3 to 4.2. here am developing an application which can support both phone and tablet. for that i created sperate layouts and saved in different folder.
i tested my application with a test device X-treme 7" Internet tablet which is android 4.0.1 version. but when i test with my tablet its not take layouts from layout-large folder. but when i test with emulator which runs android 3.0 OS it takes layouts from large folder.
and my doubt is that why my application is not working properly (ie, took layout properly) ??
The X-treme 7" Internet tablet has a resolution of 800x480. With a 7" screen, that puts the pixels per inch somewhere around 80, which falls into very low end of the ldpi scale (which is <=120ppi. To convert a resolution of 800x480 to a density independent pixel (dp) screen size, we must multiply by ldpi's scaling of 0.75, which gives us a resolution of 600dp x 360 dp.
As per the range of screen supported guide, a large screen must be at least 640dp x 480dp, therefore your X-treme 7" Internet tablet should be classified as a normal screen device, hence why it is not picking up your layout-large layouts.
You can use any number of the many apps on Google Play to confirm your tablet's screen density and what resources it should be loading.
What simulator resolution i should keep when developing application for Samsung galaxy s2 and galaxy s3 ?
What i found that samsung galaxy s2 has 480x800 resolution and s3 has 1280x720 resolution so what i have understood up till now that I should ask my graphics designer to provide me hdpi graphics that contain 480x800 background images and to implement same background image in galaxy s3 mobile, I will use image of size 1280x720 and put in xhdpi folder so that it can work on s3.
The background image is something which covers whole available area for mobile app. so am i right ??
You will need to create several emulators or get various devices.
There are some pretty important ones, so generally you need to make sure you have:
ldpi, mdpi, hdpi, xhdpi
and
small, medium, large, xlarge
Some people choose to exclude certain sizes (like small and ldpi) but htat's up to you,
if you go with some or all of the following, it should be a good start:
480x320 (SE Mini 10), 480x800 (GS2, Desire, etc), 1280x720 (GS3, Galaxy Nexus etc), 1280x800 (Note, Xoom, various other tablets)
HTC ChaCha (because it's landscape default)
You need to make sure you create resources in the relevant folders for each density, usually, I tend to ignore ldpi and just put resources in:
mdpi,hdpi and xhdpi (mdpi will be scaled down for ldpi devices,
automatically)
You may also need to create various portrait and landscape layouts in different sizes.
Reading this page provides most of the necessary information:
http://developer.android.com/guide/practices/screens_support.html
This page also contains important information regarding size distribution and popularity that is constantly up to date:
Android Stats
One thing that Android does for you is that it manages resolution. If you use the proper size formats (dp, sp, etc), your layout will scale to almost all resolutions. If you place images in the proper drawable folders (hdpi, ldpi, mdpi, etc), the OS will also swap those out as necessary.
Also, the emulator should handle resolutions for specific devices, if I recall correctly.
Desing lazout in smart way! Usualy it means don't put to mutch content in one layout.
Make sure that evrything looks good on smallest size and bigest size. It is better to treat tablets separetly. Read how providing alternative resources works, you can build sepereate layouts for each screen size.
Check if the hardware is available on that device before using it. hasSystemFeature() can be used for checking.
From your experience as an android developer what emulator screen sizes do you use?
Are there a couple that tend to catch most UI sizing issues or do you test your app in every size and density?
While coding, try to cover at least one of each from this table: http://developer.android.com/guide/practices/screens_support.html#testing . After most of the work is done, I would suggest try every combination you'll find in real devices you plan to deploy your app.
My very basic list while I am designing the UI is:
WQVGA 120 dpi
HVGA 160 dpi
WVGA 160 dpi
WVGA 240 dpi
Add 480x640 240 dpi if you want to support small screens.
You can use the pie chart here to have an idea of relative screen size usage: http://developer.android.com/resources/dashboard/screens.html
BTW, I have use AVDs from Donut to Gingerbread also.
At some point, I test on every size and density that I intend the app to run on. It's irresponsible not to do so.
But beware of densities; because of dpi scaling, you may be running what you think is an hdpi emulator, but the emulator is loading mdpi resources (or vice versa). It's a good practice when testing to log the reported density during onCreate of your launch activity. (My approach, though, is to use an app icon for each density that displays the density, at least until I want to test the real app icons. That way I can tell from the home screen what the emulator thinks it is running.)
you should test your app in every size , in order to be sure that your app will work fine in every android phone ;
and for density , try to create your UI with dip :)
hope it helps
I want to make sure that devices with 10,1" and 1024x600 under 2.1/2.2(e.g. Archos 101) are using the correct layout.
Are they large and ldpi?
Also, how can I simulate them using the android emulator?
In the end, the choices of screen size and screen density are up to the manufacturer. Hence, nobody here can answer you definitively.
A 10.1" diagonal screen should be large and probably should be ldpi, though it is possible it will be declared mdpi based upon the apparent density given the distance one would typically hold a 10.1" tablet from one's face.
Bear in mind that ARCHOS' devices do not ship with the Android Market AFAIK, and hence do not necessarily pass the various compatibility tests. As a result, ARCHOS could do all sorts of stuff that would be unexpected.
Also, how can I simulate them using the android emulator?
The Android SDK is not well-suited for testing a 10.1" LCD at this time. I would expect better instructions and support for such sizes in Android 3.0.
For now, set the resolution and density for the AVD when you create it. In this case, you would want to specify 120dpi (ldpi) for the density. Android should put it in the large screen size bucket for you, given those values. Leastways, that basic approach works for getting large WVGA devices.