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?
Related
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
I am going to create an app for devices with Android OS 2.1 and higher. As many developer I met layout problems and after reading about that in the official android documentation I decided to follow a way; I created 6 directory one for every screen density (ldpi,mdpi,hdpi,xhdpi,xxhdpi,xxxhdpi). What I want to know is if I did it right, I know that layout could be not exact at 100% but could I'll meet serious problems doing that?What I should do?
The second problem is checking app in many devices in the same time, I use Android Studio and I am able to create devices and use emulators but there is a plugin or a website or something else I can use to test quickly the app in tens of Android devices without set all manually?
Thanks in advance!
I'm currently developing an application with which a schedule can be retrieved and viewed. To display the schedule I used the TimeRulerView (and BlocksLayout and BlockView) java source files from the Google IO 2011 app because I liked the look and feel. Source code can be found here: https://github.com/underhilllabs/iosched2011 . (Google replaced there one with the code of IO2012).
Since my Galaxy Nexus updated tot Jelly Bean (4.1.1) yesterday the TimeRulerView (and/or one of the others) doesn't get shown anymore.
The weird thing is that they are actually still there, but there not visible. I can see a scrollbar of the length the timeruler normally has. Also when I normally click on an block in the view I get a little pop-up, and this still happens when not seeing the timeruler or a block.
I tested the original IO2011 app on my JB GN but nothing is visible there either, so the problem lies within (one of) the view(s) or the way JellyBean is rendering the view(s) (project butter maybe?).
See here ( https://dl.dropbox.com/u/7102660/TimeRulerView_JellyBean_problem.zip ) for screenshots on ICS (app working), JB (app not working) and the GoogleIO2011 app.
Could this be something to do with Hardware acceleration? I just recently ran into an issue on couple phones with ICS, but not all phones/devices were affected. Adding the hardwareAccelerated tag to my manifest didn't fix the issue either, and I had to define it on specific views that I did not want to be hardware accelerate. My solution used android:layerType="software" in my xml layouts and setLayerType(LAYER_TYPE_SOFTWARE, null) in the java code.
EDIT: Testing this more, it didn't fix my issue using setLayerType on Jelly Bean. Setting the layer type to software on ICS did fix my issue. The only way I could make the views show up was setting the whole application or specific activity to android:hardwareAccelerated="false".
Thanks to Chris answer I played around with hardware acceleration settings. I use the iosched2011 code as well and only had to remove the line android:layerType="software" from my BlocksLayout View inside the block_content.xml file .
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?
I have a ListPreference on my android application.
On phone 2.3.4, it has the 'downward triangle with a circle' icon on the right.
But when I run on the same app on Samsung Galaxy, it has no such icon. Can you please tell me how can I fix that?
Thank you.
The missing triangle is probably due to customizations that Samsung has made to Android. If you want to force the list preference to appear the exact same on each device regardless of the vendor you will probably have to subclass the ListPrefernce class and define exactly how you want it to appear, rather than using the definition that ships with the device.
Update I just noticed that you mention you are using a tablet in the title. I'm assuming you're using a Galaxy Tab 10.1 or 8.9. If that is the case the missing triangle is either due to Honeycomb or TouchWiz. If its a Honeycomb customization I wouldn't try to hack one in there.
It really is best for everyone if your app conforms to the UI standards put forth by the OS. Introducing inconsistencies in the UI tends to make users unhappy and can lead to interfaces that are difficult to use.