Adding code to support availability detection on Android 2.x