I know this may sound a trivial question, but I can't figure it out on my own. I've Googled and searched many many times. I know it may have a simple solution but I don't know where to search anymore. In general, I'm a Windows programmer, but I started programming for Android about 4 months ago. I've developed a fairly extensive application. The problem began when I started programming...my spinners are the solid gray rectangular style (unlike the newer style with the triangle in the lower right corner). When I started developing this app several months ago, I couldn't figure out why my spinners were different (after many hours) so I just ignored it. I'm at the point now of polishing my program and want the newer spinner style. So, I'm beating my head against the wall again. I went to my Android SDK Manager in Eclipse and updated my Android SDK Tools, Platform-tools, and Build-tools. I have the latest versions of all of these (22.3 and 19.0.1). When I create a new project, the newer spinner style appears. However, none of my older projects changed. They still have the same old gray, rectangular type spinners. I tried using a "android format" line command I found while Googling, but no luck with that either. I know there is probably something really simple I can do, but I can't find it. Can anyone help me with this? I'm using ADT Bundle with build v22.2.1-833290 on a Mac OSX Mavericks.
Newer spinner style works from API level 11.
So, you have to run in Android 3.0 and higher devices. If u want the same style in below 3.0 versions, then you have to customize your style. Like, take that newer style type of image and apply as a background to the spinner.
Try using ActionBarSherlock in your code. This will give you an advantage to have actionbar in lower versions of android. Also it contains ICSSpinner(An alternative to androids default spinner), which will give the newer look of spinners in lower versions of android.
Here's the link for ActionBarSherlock
http://actionbarsherlock.com/
Related
Good day to everyone! This is my first question :)
I am a beginner to Android Studio and I'm trying to write some code for an app. Surfing the web I've found videos showing interesting features about spinner and expandableListView that I'd like to use in my application. The problem is I can't find these items no matter what.
I have an android studio 3.5.3 version and the videos I saw showed versions 1.some.some and 2.some.some. Can anyone help me out with this, please?
Here an image about the palette I have in the android studio.
If you want to use lists in general you should use RecyclerView instead. You can still find now and then applications that use Spinners (they are under containers not widgets). – DemoDemo
Alright, I have spent 3~ hours total trying to fix this issue, and I can't for the life of me figure it out. I'm trying to start programming in Android Studio and I'm following TheNewBostons tutorials. I've followed it exactly, and every time that I switch the theme to "Material.Light" I get a Rendering Issue.
Here's the issue:
Error Message
I've tried several different fixes, like switching the renderer to a lower version of Android, editing styles.xml or something like that, and nothing has fixed it.
I've just started a new project, and haven't done a single thing. Does anyone have any light they can shed on this?
You are using the Support Design Library, and when you use the design library you must use a theme that extends Theme.AppCompat, as the error message says:
You need to use a Theme.AppCompat theme (or decendant) with the design library.
So instead of selecting Material.Light, rather select Appcompat.Light.
here I face one problem after updating this both API level 20 (L and W). in my XML Graphical view the layout is not generated instead it is showing me this error:
Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.
and also shows an error in res/values/styles.xml in this line
style name="AppBaseTheme" parent="Theme.AppCompat.Light
I use Eclipse juno.
To keep it simple, what you can do is select API 19 in the graphical layout and keep targetSdkVersion="19" and that should solve your problem. Basically the issue is with API20 bundles by google.
More insight about the issues with API 20L or 20W are already highlighted at below SO questions already...I've also responded with the google bug tracking link. Please have a look at those...
Many many issues, eclipse, android MediaPlayer, etc
latest 'ADT BUNDLE' open as JUNO eclipse for windows 7 64 bit
Hope this helps...
I am a android beginner. I am going through the book listed in the title. I haven't even made it past the first chapter without running into problems. I have installed the latest version of Eclipse. However, the examples shown in the book are not much like my version. For instance, this main.xml file that's supposed to be in the layout folder is not there. The "New Android Project" dialog box is arranged very differently and the package explorer is called project explorer. Is there a way to get this kind of eclipse in the book? Or do I just have to interpret it best I can? Any help would be much appreciated! This question has been down voted and closed by another user. Could someone please tell me why? I am just trying to get some help.
As different Android APIs(ICS, JB, etc.) are released, they sometimes change the ADT (Android Development Tools) for Eclipse. The ADT is plugin for Eclipse. This plugin is what gives you all those neat buttons in the toolbar and the XML layout interaction.
The book you are reading was designed for Android 4.0(Ice Cream Sandwhich). As of right now, Google has released up to Android 4.2.2(JB 4.2). There has been some significant changes to the ADT going from ICS to JB, but in my opinion, they are for the good. Lots of really neat and new features. Here is a Google resource explaining the different API releases for Android: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
I would say continue reading the book as it will teachs you the basics of Android, but when you want to do some in depth coding, that book isn't going to be very useful and you may have to do a little research online. Reason is, Google releases at least two new versions of Android every year. Every version changes, and adds new features. In other words, the book you are reading is already out of date. Android OS development moves way to fast for authors to keep updating their books.
To answer your question, your probably going to have to interpret it the best you can since, most likely, by June/July, Key Lime Pie is going to out, and the ADT your using NOW will be outdated. You should really learn the fundamentals of Android OS and how it works in the background and how processes things. After that, everything else should be easier to learn.
An alternative to the book you are reading is this: http://developer.android.com/training/basics/firstapp/index.html. This is straight from Google and is constantly updated and tweeked. This will be the most updated and useful information on how to write Android apps.
Hope that helps!
Greetings all,
I realize this issue has been posed before in other forms, and believe me, I have been searching the net for days trying to find the answer. However, I'm fairly new to Android and Java, and I need a little guidance please.
I presently have two version of my app, one for Android 1.5 and 1.6, and another for 2.0 and beyond. As you probably guessed, it's because the Contacts API is different.
I recently became aware that it was possible to combine both methods into a single app, by using dynamically loadable classes. Very cool! After days of attempts, I still haven't been able to do it successfully... or at least, it won't run.
I have come across 3 examples of how to do this - one by Google, called "Business Card", another that had something to do with Spinners, and a 3rd was something someone here created. My problem is that each one seems to me to have a showstopper.
I'm using Eclipse on Windows 7. My app was first created for A1.5, so that's the one I'm upgrading. What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it. Hence, it won't run. I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.
My code for this pat of my app is exactly like the Google example "Business Card" - so if someone could help me cross this hurdle, I'd be very grateful. I'll be happy to post any code that you need to answer my question.
Thank you!
another that had something to do with Spinners
If you mean this sample project, that's mine.
I'm using Eclipse on Windows 7. My app was first created for A1.5, so that's the one I'm upgrading. What's happening is that my ContactsAccessorNewApi class needs to import the ContactContracts, and according to Eclipse, that won't work because my project was originally built without support for it.
You need to set your build target (Project Properties > Android) to be high enough that ContactsContract exists (android-5 or higher).
So long as your android:minSdkVersion in your manifest is set to support earlier versions of Android (e.g., 3 for Android 1.5), your app will still install on older emulator AVDs and devices.
I've tried adding the android.jar for SDK level 5 into the project, but that creates a whole mess of other problems.
Yeah, don't do that.