Android :: Multiple Screen Support - Size / Image And Layout
Nov 11, 2010
I am trying to develop an app for which I want multiple screen support. I have read the Android article on Best practices for Multiple Screen Support. As per the article we have to follow 3 important things:
1. Mention support for different screen sizes (large, medium and small) and any density in AndroidManifest.xml.
2. Place images of 3 dpi's (120, 160, 240) in 3 folders res/ldpi, res/ mdpi and res/hdpi.
3. In layout's the dimension should be mentioned in "dip" units. Then Android will take care of the scaling on its own.
I have implemented all these points in my project. The images are picked up correctly from the appropriate folders. But the arrangements of the controls in not same. e.g. I ran the app on three emulators 1. Resolution 240*320 dpi 120. 2. Resolution 240*320 dpi 160. 3. Resolution 240*320 dpi 240. (All the emulator have same resolution but different density). The problem is the position of the controls is not same on all the three emulator. As per my understanding if the android:layout_marginLeft and android:layout_marginTop are mentioned in "dip" then this problem should not occur. As the density of the emulator increases the controls get placed more towards the right. Is it necessary that I provide layouts for all combinations of dimensions and density i.e. in layout-small, layout-large, layout- medium, layout-long,layout-notlong?
View 2 Replies
Jun 11, 2013
I am using a linear layout to draw a scalable background in my app. I am then defining multiple imageviews inside the linear layout, all of which are PNGs containing a transparency layer. I am wanting to overlay these transparent imageviews on top of the background. My issue is that only the first defined imageview shows on top of the background, any subsequent imageviews do not appear.
CODE: Note that imgSen1 appears properly with transparency overlaid on the background. imgSen2 does not appear. If I define imgSen2 first, and imgSen1 second, imgSen2 then appears properly, as if only the first defined imageview can be seen. I would like to have multiple imageviews with transparency overlaying the background.
<LinearLayout
android:layout_width="627dp"
android:layout_height="436dp"[code]...
View 1 Replies
View Related
Oct 19, 2009
So I'm trying to make sure my apps are compatible with the 1.6 SDK emulator skins WVGA800 and WVGA854. The Android Developers Blog post regarding this seems strange to me. The post talks about upgrading your app using the 1.6 SDK, then says this:
"Note that not all devices will be upgraded to Android 1.6 at the same time. There will be significant number of users still with Android 1.5 devices. To use the same apk to target Android 1.5 devices and Android 1.6 devices, build your apps using Android 1.5 SDK and test your apps on both Android 1.5 and 1.6 system images to make sure they continue to work well on both types of devices."
Now resource directory qualifiers (e.g. "res/drawable-mdpi/" or "res/ layout-large") don't work with the 1.5 SDK. So right now as a dev I have the choice to either:
1) Update my apps with the 1.6 SDK so that they are compatible with the various 1.6 emulator skins and the various hardware configurations coming out. If I do this, the updates will not be available to those users that still have 1.5, which is a "significant number of users."
2) Continue using the 1.5 SDK, without the available tools in 1.6, but try to somehow get my app to render properly in the various 1.6 emulator skins.
View 9 Replies
View Related
Nov 10, 2009
I have an app that I would like to keep 1.5 compatibility but support the additional display resolutions of more recent devices like the Droid. I've read the suggestions in the dev guide, specially the legacy applications section, since that's exactly what I want to do.I'm not running in compatbility mode, so anyDensity is set to true and all screen sizes are allowed in the manifest. I've recreated all my graphical elements so they don't get upscaled on a 480px-width screen (called "hires-bitmaps" in the following).If I put the hires-bitmaps into drawable-hdpi and leave the others in drawable, the emulator2.0 (WVGA854, density @ 240) displays them perfectly. On the other hand, the emulator1.5 (320x480, density @ 160) - and my HTC Hero - ALSO use the hires graphics in drawable-hdpi. That's a problem because the hires graphics scale slightly differently and I don't want the app to resize too much.As mentioned in the dev guide I can prevent this by adding the API version number to the resource folder. Not very convenient since I'd have to keep the hires bitmaps twice (drawable-hdpi-v4 and drawable-hdpi-v5), but I nevertheless tried it. Result: emulator2.0 uses low-res graphics from "drawable" (which is bad), emulator1.5 as well (which is good). And what's weird: emulator1.6 (WVGA854, density @ 240), uses hires-graphics. Now that seems odd.
View 5 Replies
View Related
Apr 15, 2010
In my android application, I would like to support multiple screens. So I have my layout xml files in res/layout (the layout are the same across different screen resolution). And I place my high-resolution asserts in res/drawable-hdpi
In my layout xml, I have
CODE:...........
And I have put bkg.png in res/drawable-hdpi
And I have started my emulator with WVGA-800 as avd. But my application crashes:
CODE:................
View 1 Replies
View Related
Mar 22, 2014
i have tic tac toe game and it looks different on every device on my galaxy s3 its covers 3/4 of the screen and on galaxy s1 it covers the whole screen and in tablet it only covers like 1/4 of the screen i read android.developer tutorial but i didnt understood how do i make my app the same In every screen size ( also get the images bigger)
View 2 Replies
View Related
Dec 9, 2009
I have a project compiled with and targeting 1.5. I now want to support different screen sizes instead of letting android handle the scaling.That's all I need to do, right? All my layouts are using dip, so it should scale, and I don't want to mess with different size bitmaps just yet.
View 1 Replies
View Related
Mar 6, 2010
I want to develop UI of the application which looks similar on all screen sizes. I have gone through the Android developer article regarding this. I am using supports-screen tag but then also the screen is displayed not displayed properly in the larger screens. The screen is displayed properly in HVGA and not in WVGA.
I have developed the application using Android 1.6 and set the minimum SDK version as 4. The application is running properly on HVGA avd but not on WVGA avd. Can I know the reason for it? Is there any solution for this? I want that the user interface of the application should look uniform in all the handsets.
View 3 Replies
View Related
Oct 5, 2010
I am looking for an optimized solution to display image in different screen size. I have a image in server which I would like to display in different handled devices like iPhone, iPad ,Android based tablets or mobiles etc.
View 1 Replies
View Related
Nov 16, 2010
I have an ImageView which I want to always be the same size. If the image is smaller than the view, I'd like it to be centred in the view. If the Image is larger than the view then I'd like it scaled down - with aspect ratio preserved.I've had several attempts at this myself
View 2 Replies
View Related
Jan 19, 2010
I am currently trying to make my app compliant with all screen sizes / api levels. I have this mostly working, however there is 1 issue i cannot resolve: Layouts in the "layout-hdpi" folder are used by and any phone on 1.5 (API level 3). - Which i dont want, i want API level 3 phones to use the "layout" folder. So to resolve this I added "-v4" onto the folder also, this works, the folder is no longer used by 1.5 phones. However, now the folder is also not used on API Level 6 phones, for example the droid. The droid only picks up the folder if i name the folder: "layout-hdpi-v6". (Also if i put "-v3" on a folder, the layout folder is not used by API level 4 phones) My understanding is that the -v<api level> qualifer allows you to exclude phones on an API level that is too low, so -v4 should mean that the folder will be used by all phones on API level 4 and above. I am finding a folder is only used for that specific API level. Has anybody else ran into this same issue? And does anybody know of any possible solutions?
View 3 Replies
View Related
Nov 20, 2009
Whats the default screen width of android devices? I took a 320 x 460 image for my splash screen, it did not cover the entire screen!
View 6 Replies
View Related
Oct 3, 2010
I my design (as an example), I would have two text fields defined in my relative layout followed by an image and I would like the image to span the remainder of the screen.
Here is what I have so far:
CODE:..........
How do I tell my ImageView to span fill the remainder of the screen. If I define the height and width as "fill_parent" it fills over the two text views.
View 2 Replies
View Related
Apr 13, 2010
I've read the Android documentation:
http://developer.android.com/guide/practices/screens_support.html
but still have some questions. I'm trying to design a music application which basically has images of the instrument (ImageButton) that play a sound when clicked. However, I'm confused about how to have the ImageButtons scale to fit all the different screen sizes and how to position them.
Which layout is best used for needing to position ImageButtons in specific locations on the screen? (i.e. cymbals on a drum set) FrameLayout, RelativeLayout? If I only really care about medium and large screens, do I need to create different resources (images) for both as well as a different XML layout to position them? I'm trying to find the simplest way to do this without having to create a separate layout XML file for positioning/size and separate image resources for each screen.
View 1 Replies
View Related
Jul 12, 2010
I am new to android. For getting more number of downloads. I will make application in Android 1.5 version. How can I support multiple screen resolution from android 1.5 version. Is there any problem develop application in Android 1.5 and release in market. Is it visible to higher version mobile market for downloading apk file.
View 5 Replies
View Related
Sep 23, 2010
So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds(). I've tried setting in the XML and programmatically, but neither worked. I'm very surprised setting max width/height didn't do anything. Below is the XML I'm using ImageView definition in my layout file
View 1 Replies
View Related
Jan 22, 2009
if size of image is larger than or smaller than specified display size (on screen), then it is automatically, compressed and stretched resp by android run time or require to handle by explicitly.
View 2 Replies
View Related
Jan 23, 2009
Is it possible to build a GridView object in XML with 3 columns and 4 rows of Image buttons? It doesn't seem to have similar containment relationship like LinearLayout or RelativeLayout viewgroups.
I want to do this entirely in an xml layout file. When I put ImageButton xml tags inside a GridView xml body, The layout panel in eclipse is throwing an exception: UnsupportedOperationException:addView(View, LayoutParams) is not supported in AdapterView.
View 2 Replies
View Related
Sep 7, 2010
We can view an image with What if we have some images? How can we put the extras to let the viewer know we have /sdcard/a.jpg, /sdcard/b.jpg, /sdcard/c.jpg ? I hope to do this in a time because starting an activity is very expensive. Code...
View 2 Replies
View Related
Feb 10, 2010
I have a vertical LinearLayout. I would like to layout 1 ImageView on top and 1 ImageView at the bottom of that LinearLayout. I tried putting 'android:gravity="top"' and 'android:gravity="bottom"' in each of the ImageView, but both ImageView appears at the top of the LinearLayout. Is there a way to fix it?
CODE:................
View 2 Replies
View Related
Apr 22, 2010
I've been reviewing the Supporting Multiple Screens documentation on the Android and I just need some additional clarification...
It's my understanding that designing three unique interfaces (ldpi, mdpi, and hdpi) would be the best way to go about supporting all the potential android screens with minimal scaling/distortion.
Yes, I know there are similar questions posted, however... If I create an image for the benchmark mdpi (let's say my image is 300x210, just for example) how to I determine what size I will need to recreate that image at ldpi & hdpi? This post as well as a google search leads me to believe that ldpi is just 75% of the mdpi image, and the hdpi is 150% of the mdpi image. Is this accurate?
View 1 Replies
View Related
Feb 20, 2009
I want to know when will Android support Multiple PDP.
View 15 Replies
View Related
Sep 18, 2010
I have the following layout defined: code...
now i want to get the height of the RelativeLayout (i want to specify the height of its children programatically) code...
but the size returned is 0. How do I get the size of the RelativeLayout (it's mostly pseudocode above, but both layout have a height/width of "fill_parent" in the xml)
View 1 Replies
View Related
May 4, 2010
I am new in android, i am having few problem in layout alignment. I have divide the screen into three layout,as header, body and footer. I am giving the height dynamically for the three layout in java file, so i need to give 12% of height to header and footer layout, and the remaining 75% i need to assign height to body layout. For that i have made the calculation as follow
first i am getting the height and width for the screen. With the help of the screen height i am getting the 12.5% height for header and footer layout
WindowManager w = getWindowManager(); Display d = w.getDefaultDisplay(); int totalwidth_screen = d.getWidth(); int totalheight_screen = d.getHeight();..................
View 3 Replies
View Related
Sep 27, 2010
I have following in xml
I wanna put the second linear layout at the bottom of the screen.
I have set the property of second Relative layout to bottom but still not showing at bottom..
code:...................
View 2 Replies
View Related
Apr 21, 2010
How do I change the size of the controls placed in a layout? (by any method) I tried to change the height of an EditBox ->setHeight(10); doesn't seem to work.
View 4 Replies
View Related
Feb 10, 2009
I have created a custom icon bar in Android using the XML layout creator, using a RadioGroup within a LinearLayout (XML included below). Each RadioButton within the RadioGroup has a custom drawable (with checked and unchecked states) as its android:button attribute. The Linear layout is itself within a RelativeLayout so that it can appear at an arbitrary position on the screen (as a side bar, in this instance).The drawables are 55 pixels wide, and the android:layout_width attribute of all these views is "wrap_content".When I make this component visible, aligned to the bottom-left of the screen, only about three-quarters of the RadioButton image widths are visible. Setting the layout_width of the RelativeLayout to "fill_parent" rectifies this and causes the full button to appear.However this means that the button group consumes click events across the entire width of the screen. How can I make the entire button appear, and have only the area of the button respond to clicks? Hard-coding the width of the drawable is not a particularly desirable solution.<RelativeLayout android:id="@+id/RelativeLayout01" android:layout_width ="wrap_content" android:layout_height="wrap_content"> <LinearLayout android:id="@+id/LinearLayout02" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_below ="@+id/LinearLayout01" android:visibility="invisible"><RadioGroup android :id ="@+id/ RadioGroup01" android:layout_height="wrap_content" android:checkedButton="@+id/RB01" android:layout_width="fill_parent">
<RadioButton android:id="@+id/RB01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR01"/><RadioButton android:id="@+id/RB02" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR02"/>
<RadioButton android:id="@+id/RB03" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR03"/> <RadioButton android:id="@+id/RB04" android:layout_width="fill_parent" android:layout_height="wrap_content" android:button="@drawable/DR04"/> </RadioGroup></LinearLayout>
View 2 Replies
View Related
Aug 7, 2010
I am having an issue understanding how to get Bitmaps from resources in density specific directories to scale properly when drawing them to a Surface View.If I have a resource in folder "drawable" I expect it to be scaled up when run on hdpi screens and scaled down on ldpi screens and left as is on mdpi or 1.5 screens.Likewise I expect anything found in hdpi when run on an hdpi screen to remain unscaled. However, there is some combination of settings that I am not getting right to do this seemingly simple thing.I am not running compatibility mode so my manifest supports all screen sizes with anydensity=true.I do not understand the BitmapFactory.Options fields of inScaled, inTargetDensity, and inDensity that I am thinking have to be set appropriately and slightly different for each resource decoded depending on which directory they were found in and what screen they are currently run on.
All I have been able to find is that if either inTargetDensity and inDensity are 0, no scaling occurs, but if not, scaling occurs such that inDensity matches inTargetDensity. Is this correct?I have no idea what valid settings are for these fields from the documentation other than ints.What are the integer values for LDPI, MDPI, and HDPI? And how do I determine the density of a resource in order to set this before I decode it? Am I way off base in my approach for drawing bitmaps from various resource directories on various screen sizes?
View 2 Replies
View Related
Sep 2, 2010
If I run my android application with htc magic with locale English. I find my application running properly and if I find to run it on Motorola droid with locale Korean, I find even my application(apk) cannot be installed on the device. Do android support different language? Is it because of different language OS version?
View 3 Replies
View Related
Oct 21, 2009
If an android device wants to support multiple cameras, then how does the API support this? Right now the framework API is a simple static method to create an instance of camera Camera.open(). I see couple of options:
1. Using camera.setParameters() to set a name/value pair that instructs which camera to choose?
2. It would be nice and cleaner perhaps if this was done right on the open() method perhaps with additional enum.
Obviously option # 1 would not result in any addition to the API. Does this use sound right to you to support multiple cameras?
View 4 Replies
View Related