TOPIC Solved: Answer below.
Some users have been reporting border alignment issues on some android components such as the alert popup or the editTexts. This is happening on the Samsung Galaxy Apollo (200x400) and the HTC Pro Touch (480x640) devices. I cannot replicate that because i don't own those devices and in the Samsung Galaxy S and emulator everything looks just right.
I think that the problem is the dpi or resolution of the device (because the edittext background is a single .9.png so image should look ok); however I am not sure if the supports-screens tag is the solution. Also, application was developed using Api 3 (v1.5) and supports-screens was not yet supported, nor the screen-size resource qualifier.
The style used for the alerts and editText is the phone default. Could the problem be something related with the theme applied to the phone by the user?
Thanks in advance!, I show some images given to me showing the problem:
It might actually be the display density causing this. If you don't provide assets in the appropriate density, the framework will try to rescale your images, including 9patches. Unfortunately there's no real perfect way of resizing 9patches and it can sometimes lead to artifacts, although I would be very surprised if it caused the type of artifact you are seeing.
I've had the same problem and the solution was changing the font size of the TextView from 16px to 17px (or any other odd number).
Well it really was the resolution/density. I managed to create an emulator with the WQVGA density (which needed > Android 1.6) and replicate the error.
The solution is seen on the Supporting Legacy Applications section of the Android Developers webpage: http://developer.android.com/guide/practices/screens_support.html. So a newer version of the API is needed in the project but it still holds support for the 1.5 version.
Thanks.
Related
The screens in my app needs to be displayed in the same way on both type of devices, phones and tablets. Currently my app works fine on phones, but they behave weird when run on tablets. The problem occurs with the positioning and size of components in the screen.I have 9 patch images generated for all the images being used but still for some components that I use absolute size/margin values such as 30dp,50dp etc do not seem to be good measures that work well on a tablet. Some of my thoughts/questions are:
PercentRelativeLayout - is it the best solution to overcome this
problem?
Is there a way that layouts can be defined so as to draw
differently on phones and tablets. Please note that that I do not
have any complex menus or behaviour that needs to work differently
on different devices, they are same.
Do I have to develop 2 different apps?
you have to make different layouts for both android phone and tablet.
Look at this link
Read more on the Android developer documentation after reading answers above. Found this resource to be more explicit for someone who is totally unaware of supporting multiple screens. http://www.survivingwithandroid.com/2012/07/how-to-support-multiple-screen-in.html
I have wrote an application using android 2.2 in eclipse.
My app is working fine on the samsung galaxy mini android 2.2. However, it is not working on samsung galaxy s3 android 4.1.
My app is only taking up half of the screen on the samsung galaxy s3.
Why is my app not working on higher resolution devices?
How can i make the app compatible with other devices running
different versions of android?
Sounds like it's most likely you just have a LinearLayout at the top of your layout XML and it just takes up less space on the S3.
I would advise taking a look at the two links below; if you want a specific starting point, you could adjust your layout to match_parent and use the l/m/h/xhdpi folders to place different size graphics in. Also worth checking whether you are using dp or dip (density independent pixels)
http://developer.android.com/training/multiscreen/index.html
http://android-developers.blogspot.co.uk/2012/11/designing-for-tablets-were-here-to-help.html
The best way to ensure that your app will work on other devices is to get access to other devices and test your application on those devices before you release.
Another way is to make sure that you are targeting the correct SDK you need to target and use the AndroidSupportLibrary when needing to have backwards compatibility.
For us to help with your specific problem we would need more details as to what exactly is going on, but make sure the packages and libraries you are using are compatible with the android versions you are trying to target.
And make good use of the AndroidSupportLibrary.
Did you check the resolution compatibility? This seems more like an Android Manifest issue then an Android version issue.
The website is tavistockrestaurants.com. We are trying to make this design work well in popular mobile devices. A particular android device seems to be enlarging the text, and I am unsure why. This causes the "contact" link in the top to wrap, and causes unecessary line breaks throughout our website. Notice the form is getting pushed below the images in this screenshot? It's supposed to have white space on the bottom!
We do have -webkit-text-size-adjust: none in place for all elements (using asterisk *). Is there an android equivelant? Has anyone experienced this on any android devices?
This behavior does not occur on all android devices. We have only seen this on Android 4.x, but I cannot reproduce it with my android 4.0 emulator.
What it currently looks like:
What it should look like:
(I do not have the specific device model used in the screen cap)
In CSS, pixels are not pixels.
Or rather, 1 CSS pixel does not always map to 1 hardware pixel. On certain high-DPI Android devices, one CSS pixel can be 1.5 or 2 hardware pixels. The Opera guys have a good overview on the topic.
Samuels answer is correct.
There is a workaround though. You can target specific devices and change the styles for that device specifically using classes or stylesheets. If you are using PHP you should be able to parse the "User-Agent" and determine which device the client is using and add a class to the body tag (and use that class to target that specific device in your CSS).
There are also services that will allow you to send users to a different version of the site depending on the device they are using. Here is a site that does the work for you.
There may also be device specific CSS being generated on loading the page. Using a CSS reset may also help your site be more cross-browser compatible.
Sometimes I notice the Android emulator starts with a very small font size. This seems to happen randomly. Other times it has a normal font size.
I use ADT 10.0.1.
Do you know what is the problem?
This happens very often, and although I'm not sure about the exact reason behind this, it seems that somehow the wrong density was detected for this and resources for a lower dpi is loaded inside a higher dpi emulator. That's why everything is smaller, but the layout works properly and aligns things at their own places. And you're right: when this happens, network doesn't work in emulator! These two things seem unrelated, but my guess is that emulator fails at loading config for the current virtual machine successfully, and that includes density and network capabilities.
Anyways, there doesn't seem to be any official info on this, and similar reports in android-developers mailing list didn't get any response for developers of Android, although this is a very popular bug.
And the solution right now is only restarting the emulator. Sometimes you have to do this more than once, but finally it works.
Make sure your computer's display resolution can satisfy your emulator's exact resolution. If you are using Mac with Retina Display, this problem may occur. Try changing display resolution via Display settings.
I wrote simple aplication for android. It works great in emulator. But when I installed it on real device (htc wildfire) then the interface became ugly. Except that it works good. TextViews look fine but the buttons, sprinners and list items look bad. Button corners seem wretched. All the lists (list view and list preference have no delimeter(line) between rows! When I scroll a bit the delimeter appears). Why?
The buttons probably become stretched because you're not using 9 patch images. Here's a good tutorial on 9 patch images http://developer.android.com/guide/developing/tools/draw9patch.html
Regarding the list view, you might want to set this field inside listview in your xml file
android:cacheColorHint="#00000000". That might do the trick.
Have you specified a targetSdkVersion in the uses-sdk tag in your manifest? If you haven't, Android will assume your app does not know about newer platform versions with different screen sizes/densities and run your app with compatibility scaling.
You should always set targetSdkVersion to the newest version of Android that you are targeting. This helps let Android know what compatibility behaviors to use for your app if things changed in newer versions. targetSdkVersion can be greater than minSdkVersion, meaning your app knows how to take newer platform features into account while remaining compatible with a minimum version.
Most likely, screen density is different on the device. Instead of specifying sizes in pixels (px), use sp for font size and dp for everything else. This way they will scale properly.