Is there a way to include a library based on API Level or an if statement for Android
<p>So I have a API issue. So i am creating a class that utilizes <code>AndroidHttpClient</code> to download Bitmap images from my server. Problem is, <a href="http://developer.android.com/reference/android/net/http/AndroidHttpClient.html" rel="nofollow">its API Level is 8</a> and I want this to be used <strong>from API 1 and above</strong>. Now I know I can use <code>DefaultHttpClient</code> (the API is Level 1) but is there a way I can use both, being distinguished by Build.VERSION.SDK (btw thanx for the quick respose, Konstantin Burov and iandisme). </p>

<p>So for example, if my device is 2.2 I use <code>AndroidHttpClient</code>, anything else use <code>DefaultHttpClient</code>.</p>

<p>Of course if I import the library it will give me an error on any device 1.5 to 2.1. </p>

<p>Any suggestions would greatly be appreciated, because in the future I would want to set other preferences based on API.</p>
