My question is whether I would need to include the appcompat library if I never call any of its methods if I detect an earlier version of Android on the device.
No, then you wouldn't need it. The appcompat library is a bit more than just a back port of the ActionBar
. It also includes a few little fixes for platforms newer than Gingerbread. Here is an example. As you can see there are implementations of the ActionBar for HC, ICS and GB for the Appcompat ActionBar
, that all derive from a base implementation. But in general you don't need it, if you aren't using the ActionBar
in earlier versions. The ActionBar
is stable enough and the fixes made with the appcompat library for later versions are not very significant.
If you wrap something in Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB
then it is guaranteed to not being called in a version earlier than HoneyComb, so no, you can keep doing that for API's, that were introduced later without crashing earlier versions.