Android :: Supporting Multiple Screen Sizes Using Image Buttons
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
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
Oct 30, 2009
I have had several emails from people with HTC Tattoo devices who say they cannot find my app in the Market.
After reading this page (http://d.android.com/guide/practices/ screens_support.html) I believe I have to add the <supports-screens> tag to my manifest file. However, when I try to do this I am confronted with "Error no resource identifier found for attriute support-screens in package 'android'" messages. What does one have to do to update their manifest to tell the market an app supports all screen sizes?
Furthermore, if I need to change the android:minSdkVersion from "3" to something higher or add the android:targetSdkVersion tag, will this prevent people with older versions of Android from using my application?
View 4 Replies
View Related
Dec 16, 2009
I have created layout-large and testing against android 2.0.1 WVGA. however, its picking layout-normal. Can anybody suggest me what I am doing wrong. Even though, I have 3 layouts ( layout-normal, layout-large, layout- small), Its always picking layout-normal. why its so.
I added properties to manifest file
CODE:.............
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
Aug 12, 2010
With the many devices available, each with different screen density and resolution, I am wondering - how many versions of an image should I make for the different device screen sizes? Is it 3? small, medium, large or just 1.
View 4 Replies
View Related
Apr 15, 2010
I have an image on a private file.
I read the file, create the drawable, and assign it to an ImageView.
The ImageView has WRAP_CONTENT so the size is automatic.
On 320x480 screens, the image looks good
But on screens with more resolution and high density 480x800 or 480x854 (N1, droid) , when the image is for example 150x150, I see the image as 100x100.
Of course it has something to do with the density but not sure how should I resolve this.
This is my code...
if I then inspect the size of the icon, android thinks the size is 100x100, when really is 150x150.
Looks like its reducing the image by the density.
Can anybody explain this and how to avoid this.
View 1 Replies
View Related
Mar 1, 2010
i am developing a game and i need to use android1.5 only.
i wrote sample application using 1.6 and kept drawable-hdpi,-ldpi ... and application is working fine in emulator of 1.6. i made apk and opened an emulator (android 1.5) from command prompt application is also working fine.
in 1.6 if i change emulator resolutions the application UI is resizing. but in 1.5 emulators not.
is that mean, the application developed in android 1.6 runs in 1.5 emulator but multi screen support is not achieved?
..."how to achieve multiple screen sizes in android 1.5". multiple screen support is available from 1.6.
View 6 Replies
View Related
Apr 14, 2010
I'm confused regarding the densities. I see that with medium density, the screen resolution could be either 320x480, 480x800, or 480x854. So if I have an image thats 300px wide in the mdpi folder, how is it going to look the same size on all 3 different screen sizes (mainly 320x480 vs the other 2)? And by look the same size, I mean scale to be bigger or smaller depending upon the screen size.
View 5 Replies
View Related
Aug 8, 2010
The following code is from http://developer.android.com/guide/topics/ui/ui-events.html and shows how to handle a click on a button (called corky, I think) If I had several (say 10) buttons on a form, each launching a different subscreen, would I have to find and repeat the setOnClickListener statement for each button, then put a switch statement in the onClick subroutine, or is there a better way to do it? (I'd rather not resort to naming my buttons Button1, Button2 etc and using a loop). code...
View 2 Replies
View Related
Jun 11, 2010
In the Supporting Multiple Screens document in the Android Dev Guide, some example screen configurations are given. One of them states that the small-ldpi designation is given to QVGA (240x320) screens with a physical size of 2.6"-3.0". According to this DPI calculator, a 2.8" QVGA display equates to 143 dpi. However, further down the page the document explicitly states that all screens over 140 dpi are considered "medium" density.
So which is it, ldpi or mdpi? Is this a mistake? Does anyone know what the HTC Tattoo or similar device actually reports? I don't have access to any devices like this.
Also, with the recent publishing of this document, I'm glad to see we finally have an explicit statement of the exact DPI ranges of the three density categories. But why haven't we been given the same for the small, medium, and large screen size categories? I'd like to know the exact ranges for all these.
View 1 Replies
View Related
Jun 9, 2010
I have read the topic about supporting multiple screen size as well as different DPI. I am wondering which of the following way is better in supporting multiple screens:
1. Have different layout for different screen size (stretch the images)
2. Have different set of graphics for different screen (use the same layout)
3. Have different set of graphics and different set of layout for each of the screen
Which way is the easiest? And which way is the most optical way to design? Or is there another better way?
View 2 Replies
View Related
Jul 25, 2010
I've read the article "Supporting Multiple Screen" on Android developers site. But that doesn't apply to game logic.Let me get straight to the point. My situation is as follows:
- I'm creating a game using LunarLander code as a base.
- In my game, there'll be an object flying up from the bottom of the screen. The object will fly in projectile motion.
- I set the starting velocity, gravity and angle so that the highest point(of projectile motion) is almost at the top of the screen.
- The screen tested is Motorola Milestone. (480x854 resolution) Meaning the object travels around 854 pixels vertically.
I'm thinking of adjusting starting velocity based on screensizes. But that sounds unreliable when we've so many devices/resolutions out there. How do you combat these kind of problem when making games?
View 3 Replies
View Related
Jul 31, 2010
What I'm trying to do is have a clock widget of different sizes (i.e. 2x2, 3x3, 4x4 etc) in one apk and a configuration activity to be able to select which size to add. From what I've learned from documentation:
Widget size is specified in <appwidget-provider> tag in respective xml file
Also in that file I set up the configuration activity for that provider
So it seems that size is a property of AppWidgetProvider and I'll need to somehow create another provider from the code in configuration Activity of the first one. I have read this and this. First one explains how to put multiple wigets in one apk, but it's not clear how to select between them in runtime. Second one is about changing layouts, but not size.
View 2 Replies
View Related
Aug 19, 2010
My application will have two layouts, one for large screens and one for normal. For testing I'm working with one phone (800x480 240dpi) and one tablet (1024x600 240dpi) but both are detected as large screen hdpi and long aspect ratio, so I'm not able to assign different layouts.
The only approach I think that can work is to create layout-large and layout-normal, get the resolution and programmatically set the layout folder. Is that possible?
View 6 Replies
View Related
Sep 2, 2010
I am very new to android,i developed an sample web application and hosted it apk build file in different android version and on different sized devices,here i am getting problem in my design of layout such as listview not being displayed properly bottom portion is not displayed well and the align is not so good.
View 3 Replies
View Related
Dec 7, 2009
I have noticed that when I install some widgets I can later choose from different widget sizes while adding widget. How can I implement that feature in my widget?
View 2 Replies
View Related
Oct 18, 2010
I have developed an application which en-composes list views and posted that .apk file in my htc device, the design and alignment everything works fine,but the problem When i am testing in various devices such as Morotolo Droid,Nexus Devices the alignment of Listviews goes wrong, so i planned to use the Layout folder as layout-hdpi,layout-ldpi, and layout-mdpi, for that i changed my manifest file as
<supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:anyDensity="true" />
Is it right putting android:anyDensity="true",also i used dp instead of dip. I went through this url, but still am not able to get a clear idea in this
http://developer.android.com/guide/practices/screens_support.html. so friends pls tell me(help me) to get clear idea in this and tell what mistakes i have doing. This is my main page xml code frnds.
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost" android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background_retinav2">
<LinearLayout android:layout_gravity="center" android:foregroundGravity="bottom" android:background="@color/white" android:id="@+id/rl_1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal">
<ImageView android:paddingTop="3dp" android:id="@+id/starthideimage" android:layout_width="30dp" android:layout_height="35dp" android:src="@drawable/newback" />
<HorizontalScrollView android:paddingTop="8dp" android:id="@+id/gv"
android:layout_width="wrap_content" android:layout_marginTop="0dp"
android:layout_height="wrap_content" android:background="#ffffff"
android:scrollbars="none" android:layout_weight="1" android:foregroundGravity="bottom">
<LinearLayout android:id="@+id/san_tag" android:layout_width="wrap_content" android:layout_height="wrap_content">
</LinearLayout>
</HorizontalScrollView>
<ImageView android:paddingTop="3dp" android:id="@+id/Endhideimage" android:layout_width="30dp" android:layout_height="35dp" android:src="@drawable/newforward" />
</LinearLayout>
android:id="@android:id/tabs"
android:gravity="bottom"
android:layout_gravity="bottom"
android:listSelector="@color/gray"
android:layout_width="fill_parent"
android:layout_height="wrap_content" /> </TabHost>
View 1 Replies
View Related
Feb 17, 2009
We understand aapt has support only for small and numbers. Any reason for not supporting capital letters.. in future could we expect support for the same.
View 4 Replies
View Related
Aug 9, 2010
I'm looking at creating an AppWidget and want to have the user select which size they want before adding it. Thus, the user can choose 1x1, 2x2, etc. The Calendar widget in Android 2.2 (and possibly earlier, but not in 1.6) does this. How is this done?
View 11 Replies
View Related
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
View Related
Oct 19, 2010
Is there a way to use an image size when setting the sizes of a view? I want to create a TextView item with the exact height of a resource image, but I don't want to use the image as a background for the text view.
View 1 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
Nov 13, 2009
I've got a quick question about screen size support. Currently, I've got an application that is rockin' along just fine on 1.5 and 1.6. Today the client called and says they want to run on Droid. While I've downloaded the 2.0 SDK, I'm a little wary of compiling against it. Will it break 1.5 and 1.6 compatilbility? How will the "medium" phones (G1, MyTouch) know to use those layouts?
View 3 Replies
View Related
Oct 20, 2010
I created a list view in an activity and the list shows some fields.When we click a list item a custom dialog should pop up and the user can enter some new value to this field.The custom dialog contains one edit text and two buttons ok and cancel.It is working fine.But when my list is more that means if it exceeds screen size it is showing scroll.But when we select bottom items which we can select using scroll the dialog is appearing in normal fashion.But after entering new value if i am trying to save the application is getting crashed.
View 3 Replies
View Related
Jul 29, 2009
I am not able to find out the perfect layout(viewgroup) to place four buttons as shown in the attached image. Basically, i want to place four buttons near the top/left/bottom/right edge of the screen. AbsoluteLayout helped, but it is deprecated (It is also better to avoid AbsoluteLayout as it is not very flexible for orientation changes)
View 2 Replies
View Related
Oct 15, 2010
I want to develop an application for a tablet of 480*800 screen pixels. I had developed an application for normal mobiles, but now this screen size is large than normal size. what precaution should I take while developing the application? Because device is not available right now so I must have to work on the project using emulator.
View 2 Replies
View Related
Aug 25, 2009
G1, Dream, Magic, Hero, Galaxy and more to come... Does anybody have a rundown of their screen sizes (and of some of the devices to come out)?
View 2 Replies
View Related
Nov 29, 2009
Hello, I would like to ask what settings are necessary for my application to be available on all screen sizes: Is it enough to compile it using SDK 1.6 (but target is set to 1.5 and API level to 3) or maybe I have to set target to 1.6 and API level to 4?
View 4 Replies
View Related
Apr 27, 2010
supporting multiple screens (sizes and resolutions). I´ve searched not only this forum but many different websites and the android documentation but I´m probably doing a small mistake so things are not working properly.
Well, my main layout was designed with a HVGA screen, and it works great. When I try the same app on a WVGA, FWVGA, WQVGA or FWQVGA, I always get an unused space in the end of the layout because the screen ´s "heightnes" is proportionally bigger than HVGA´s.
So I consulted the documentation and decided to give a try on resource qualifiers, so I then created a nonsense UI and placed it on layout- large, created a new AVD using the WVGA skin and launched the app. Well, all I got was my old and not well stretched layout. The same happened to a FWVGA AVD.
This is the first problem. The second is: medium high density medium size screens and medium density large screens have the same resolution: how can I create a layout that is loaded for both, but not for (for example) medium size medium density or small size medium density screens?
View 10 Replies
View Related