Make Android integration more robust for API >= 11