Search code examples
javaandroidandroid-compatibility

What version of Google APIs should I use when I target older Android devices?


I have an Android application that I designed for API 15 devices and upwards i.e. ICS. Now I'd like to also target API 10 devices i.e. Gingerbread. In order to do this I used ActionBarSherlock.

Okay, so I followed the docs and got Sherlock. I updated my code. I had one activity which was MapActivity and this needed to be replaced by the SherlockMapActivity. Done.

In my project's build target, I specified the target as "Google APIs for API 15". In my application's manifest file, I've set the minimum SDK requirements to API 10. Now when I've created a Gingerbread emulator and try to launch my application, I get the following error:

Package com.mridang.soemthing requires unavailable shared library com.google.android.maps; failing!

I understand that this is because Gingerbread is missing the "Google APIs for API 15" which is understandable but if I set the project's build target as "Google APIs for API 10" then I can't use the block of code that I have that uses the CalendarContract which only came in the future APIs.

It seems to be a Catch-22 situation and I can't seem to understand how to make my application work on both devices. Any help?


Solution

  • You cannot use CalendarContract on Android devices running less than API Level 14.

    you can get More Details HERE on Commonsware Blog Spot.