HI stackoverflow friends,
On recent days I am facing an issue in android layout. I have a made an app that needs to run on android phones and tablet. So I made independent layouts for phone and tablet as descrided in android developer document. But my edittext and button appears a blurry in tablet but it works perfectly in phones up to 2.3 .My design is same in both.During design time ,graphical layout show the correct as I need. On running on emulator and on actual device it appears as below. But It perfectly ok in phones(2.3).
Tablet layout.
Phone layout as I need
I have noticed that when my layout screen becomes large it becomes blurry feel.
I couldn't figure out what mistake happened to me.
UPDATED
In my Manifest.xml I have added
<uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="13" />
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens= "true"
android:anyDensity="true" />
But no effect.
Any help would be appreciable.
It might be in compatibility mode. From the documentation,
"...if your application does not successfully follow the guide to
Supporting Multiple Screens, then it might encounter some rendering
issues on larger screens."
The manifest needs to be adjusted to disable compatibility mode.
http://developer.android.com/guide/practices/screen-compat-mode.html
I figure out my issue. By setting theme in application element
android:theme="#android:style/Theme" in manifest.xml file.
<application
android:label="#string/app_name"
android:icon="#drawable/logo"
android:vmSafeMode="false"
android:theme="#android:style/Theme">
Thanks to all for supporting me.
Related
I've built a test app to demonstrate the problem.
I have an Android app which has a couple of buttons with semi-transparent gradient background.
The problem is - when the button is pressed, the space under the button turns black (screenshot provided).
After a long time of searching for the cause i've found, that the problem is caused by this entry in the AndroidManifest.xml:
<supports-screens
android:anyDensity="false"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true" />
If i delete it, everything is ok. Anyone have any thoughts on this one?
P.S
I should mention, that this may be device specific, since i have a Samsung Galaxy S phone (i9000) but with android 4.3 flashed to it (don't judge me on that :D)
It is probably to do with the line
android:anyDensity="false"
According to the official documentation on supports-screens found at Supports Screens Element,
"you should not set it "false" unless you're absolutely certain that it's necessary for your application to work."
It then references the documentation on Supporting multiple screens which says that if it is false, the drawing operations can have unexpected behaviour. See Supporting Multiple Screens, point 2 on Auto-scaling of pixel dimensions and coordinates.
Hopefully this provides an explanation.
I have made a Worklight application using jQuery Mobile v1.3.1 and I am facing an issue while changing the orientation from portrait to landscape and viceversa.
Issues:
It takes time for managing the UI according to Landscape or portrait
when rotate.
While rotating from portrait to landscape, on half rightside white
area display for 2-3 second then it manages automatically.
Android OS Version : 4.0.0
Worklight Version: 6.0
Try Ishai's suggestion, given in this question: IBM Worklight: UI Performance
Quote:
In your AndroidManifest.xml
Replace <supports-screens ...> node with the following: <supports-screens android:largeScreens="true"
android:normalScreens="true" android:smallScreens="true"
android:resizeable="true" android:anyDensity="true" />
Replace <uses-sdk ...> node with <uses-sdk android:minSdkVersion="9"android:targetSdkVersion="17" /> and move
direct after <supports-screens> Node.
Add screenSize to android:configChange attribute under main Activity.
Build against SDK Version which greater than 3.2. (Click properties on your Android project and then click on Android, see screenshot).
In general there were several performance changes in the upcoming Worklight 6.1.0 that should make noticeable difference when using jQuery Mobile in Android.
When I use toasts in my app, the size is very very small. But when another app displays a toast, the size is normal (like Advanced Task Killer, or SMS).
What do I have to do to get normally-sized toasts?
I have a Galaxy Nexus ICS=4.0.1, and my app is using SDK API level 7 (android 2.1+).
Thank you ! (x1000)
Adding
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true"/>
to my manifest, solved my problem...
you may need to use a Custom ToastView
Maybe this is a theme problem... Can you try to implement Using Holo while supporting Android 2.x in this post ?
I finally fixed this by removing android:anyDensity="false" from my supports-screens element in my manifest. I'm not sure why I had it there in the first place, except that I started that app from one of my rather old apps instead of from scratch.
That setting also caused my activity to be realllllly small (order the order of 25px by 20px) when I ran with targetSdkVersion 14 or 15 on my nexus. Seems like a bug.
I have created a map application for android smart phones and I want it to test on real device.I want to test it on galaxy tab as I don't have android phone to test but when I am running it its UI get destorted. Can anyone suggest how to run it on tablet.
Without knowing how it's distorted it's tough to say, but you probably need something like:
<supports-screens android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
/>
in your AndroidManifest.xml inside the manifest element.
Hope you have read the Android documentation about how to handle different screen sizes. If not please read it. Because that is the best way to avoid bugs related to UI.
You said that you have upload an image, but I can't see it. If that don't work please give us more information. Sometimes app crashes if you are trying to change the orientation in real devices. Hope you have tackle that problem too.
I've created a device targeting 2.1 and having a screen screen size of 480x800 (WVGA). Some apps, including the one I'm currently writing, as well as the ApiDemos example, won't run fullscreen. I've uploaded a screenshot here: http://img248.imageshack.us/img248/503/emulator.png
What could cause something like this? If I run these apps on my HTC Desire (which has the same resolution), they utilize the whole screen like they should.
Well I finally found a solution. In case anyone else comes across the same problem, the solution is to add the following to your AndroidManifest.xml:
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:anyDensity="true" />
<uses-sdk android:minSdkVersion="4"/>
<uses-sdk android:targetSdkVersion="10"/>
Putting sdk version in androidmanifext file will make it work too.