In my application I want to target all Android Versions >= 8 (Push-Notification required), but I’m having a hard time understanding the right combination of APIs / dependencies I need for my project setup.
The project will need Google APIs for location based services, and I need to / want to use ActionBarSherlock for ActionBar support.
Is this setup correct?
AndroidManifest.xml:
(1)
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /> <application android:theme="@style/Theme.Sherlock.Light" > ...
Libs:
(2)
I added android-support-v4.jar
Project-properties:
(3)
Set to Google-APIs 16
ActionBarSherlock:
(4)
I followed the video at ActionBar-FAQ to set-up ABS as a library project, and I have it set to Android Level 16 in its project proberties, and added android-support-v4.jarin its lib folder.
I know it’s kind of a basic question, but I’m not sure if I’ve chosen the right setup. I’m especially wondering if (3) is correct or if I am supposed to set the overall API-Level to 8?
Update 1: I also have a problem understanding the mechanisms of support.jar. If I set my build-target to maximum – how does the system make sure that high-level functionality (like fragments) work in lower APIs (like 8) . Is this done automagically, or do I have to manually code against support packages?
Update 2 Regarding support.jar I will have to know what features I’m using and will have to code against support.jar. If I fail and use a feature which is too advanced, a ClassCastException on lower API levels will be thrown…?
Any help appreciated. Also: I’m a beginner, so answers with some background information would be highly regarded 🙂
Thanks!
That looks right. As described in the video on ActionBarSherlock.com you want your step #3 set to the highest “Project Build Target” available for your version of ActionBarSherlock. So if you have ABS 4.1.0, you want Platform 4.1, API 16.
Have you also set up the ABS project as a library? Your project’s dependencies should have both: