Despite Google attempt to keep pushing newer version of Android to the market. Device manufacturer is still lacking behind in conveying the updates to user for various reasons. Geeks around the world has been benefiting from community projects such as CyanogenMod for alternative in getting the updates. On the other hands, non-tech-savvy user is still desperately locked on the decision made by their device manufacturer. This results in, by the time of writing, Gingerbread (API Level 10) still holding on 28.5% of the available device. You can see the updated distribution here btw.
Now, for us developer, this means that not supporting those devices equal a big lost in market opportunity. Luckily Android have backward compatibility support for their newest features covered in the form of Support Library. The guidelines for using it has also been covered there, but.. I encountered a couple of slight bump when trying to use the v7 support library with eclipse.
What they tell you to do, to set it up is basically :
- Download the library,
- Import the library project into eclipse and configure it,
- Tell your project to use the support library.
What they don't tell you though is, since Android uses Ant, it has the same limitation that Ant have. So for the support library to be installed correctly, you want to make sure that :
- The path leading to the support library must have no space. I find it work best to just copy the whole project that I use (e.g:
appcompat), and put it alongside the project using it, then target it using relative path. Example, If your project is at
/path/to/my/projectthen put the library at
/path/to/my/librarySo that you can refer to it using
When they tell you to "Add the library to your application project", what they meant is actually to:
- Open the project properties
- Go to Android
- Under "Library", click Add and choose the intended library.
- See that there is a green checkmark. If you get a redcross instead, it means that ant can't find it, and it usually means the path leading to the library have invalid character (like space).