9-patch not working in ICS - android

I have a 9-patch file that works fine in Android v2.2 but when I run the app on the ICS emulator, it defaults to stretch scale. Check out these screen shots:
Anyone run into this problem before?

Not sure if this is helpful or not, but I saw a similar issue once with 2.3.3. I just did a clean in Eclipse and rebuilt the app. After that, the 9-patch drew the correct way.

ICS is a little pickier about 9-patches due to the new hardware-accelerated rendering pipeline. In particular, if the incompressible parts of the patch are larger than the region in which you're trying to draw it, weird things can happen.
Can you supply the .9.png you're using in this example?

Related

when open on emulator, the gradation is not smooth visually

I have a gradation like below.
but the problem is when I see this on emulator (Android Studio Emulator)
it`s not very smooth it seems like very layered (photo below)
my programming language is flutter and android
why is this happening? how to solve this?
It uses a low-quality renderer so that it runs fast enough especially on less powerful hardware. Test it out on a real device and you'll likely see better results. I believe you may also be able to bump up the graphics on the emulator but not 100% sure if that would improve this. See here.

4k display & Android emulator: fail

I'm moving to my new laptop which has 4k screen (3840x2160, to be exact). As my OS of choice I have Linux, and all scaling I have set up for this is done via Gnome (scaling-factor in gnome tweaks is set to 2). Overall, setup looks perfect, except for Android AVD run in IntelliJ IDEA.
AVD is configured to use skin with 1920x1080 dimensions, and I've expected that it would be roughly the height of the screen, however for some reason AVD is scaled up, which obviously looks.. weird and unusable.
I've took a look at relevant questions here about scaling the emulator, but it seems that IntelliJ interface has changed, as there is no Emulator tab in Edit Configurations menu (and answers to questions I've seen said to use that option to downscale the emulator). So, question is: how do I scale it down (or, to put more correctly, how do I disable the scaling for emulator)?
Ok, I've found out what the issue was. UI scaling is handled by Qt in case of android emulator. It was set to: QT_DEVICE_PIXEL_RATIO=2 somewhere in my configs. This made emulator act weird. Cheers!
Just delete the environment variable and restart Android Studio to get the new env variables.

Why does my Android studio preview look different?

I'm wondering why in every tutorial I watch the preview section looks like this: i.e it has the actual device shown as preview and has a button for linking it to an activity
When mine looks like this: for some reason doesn't have the device
I'm sure I've just not installed something correctly or not clicked a checkbox, or a version of something is wrong but after some googling i can't seem to work out what it is. Any help would be greatly appreciated.
Newer versions of Android Studio do not show the device bezel by default. Everything looks installed correctly.
Look at the Android Studio window title.
Your video is using 2.0 Beta, and your newer version just doesn't have the bezel.
You'll also notice there's different buttons around the screen preview area.
You could disable it in older versions, I'm not sure if it's completely gone but it was probably removed because it took up screen space and didn't serve much purpose

Unity3D Android visual artifacts

Since a while ago I started having some artifacts on some android devices. I have checked build settings, I was disabling code stripping and setting all options to the default ones - nothing worked out.
This visual interference (see screenshot) happens at least in Note II and HTC One Mini/2. Nexus 5 exhibited very minor interferences.
Any help would be highly appreciated!
Picture here
Well, that was quite obvious, I just needed to turn on my brain, lol.
So, if you're having issues with rendering like I was - try to check your main camera.
And especially be careful with Clear Flags property. Personally, I have faced with a situation when some of my background layers (which have SpriteRenderers on) were switching their alpha values. At that point camera would "see" through the layers. And that is the problem if you have "Don't Clear" value in "Clear Flags" property.
Hope it helps.
which Unity version are you using? Can you make sure to use ETC1 compression (+alpha if needed) and try again on those devices?

Ugly Widgets - Android

I'm new to Android programming, and i'm building a small test program.
My problem is that in the graphical layout of the .xml files the widgets(Spinners,Buttons...) looks nice and round, but when I put my program into my phone(Nexus S, if that matters) or in the emolator, they come out with rounded edges,making the whole program look really ugly.
Is theres something i'm doing wrong?
Thanks!
The problem is that you have set the build target to 2.2 or earlier and Nexus S is running 2.3, which has redesigned UI elements. If you set build target to 2.3 it sould show the same (not rounded) buttons and other elements in the Eclipse XML viewer as they are in the Nexus S.
I believe the Nexus S doesn't use the default android theme. Many of the standard UI items (radio buttons, buttons, check boxes etc) will have a different look than the UI builder will show.
Edit: wait...its showing up different in the emulator too?? my answer may not apply in that case, sorry :-\
So the unrounded buttons are the new ones? Isn't that stupid? The are uglier.
And I set the build target to 1.6, and both the emulator and the nexus s are running 2.3,so that explains it.
Does anyone has a guide that explains how to change the UI items to nicer ones?

Categories

Resources