Tuesday, October 2, 2012

Eclipse - ActionBarSherlock

To get ActionBarSherlock examples working in eclipse:
  • Download ActionBarSherlock (ABS) .zip or .tar file and unpack it somewhere.

  • First import the library project with: File → New Project → Android → Android project from existing code. 
    Select the "library" subfolder of ABS as root.
    Tick "Copy projects into workspace" checkbox.

  • Then import the samples project with the same steps above, using "samples/demos" subfolder as root.

  • If you get "Call requires API level XX (current min is X)" errors:
    1. Go to Project Properties > Java Compiler. Use JDK 1.6. 
    2. Ensure you're compiling both the library and your app with Android 4.0+ 
    3. Ensure you're targetSdkVersion is 14 or higher.

  • Then, if there are some errors remaining:
    1. Right click on project -> Android tools -> Clear Lint Markers.