So I have a problem with the API. So I create a class that uses AndroidHttpClient to load bitmaps from my server. The problem is that its API level is 8 , and I want this to be used from API 1 and above . Now I know that I can use DefaultHttpClient (API level 1), but is there a way I can use both options, being different from Build.VERSION.SDK (thanx battles for quick repetition, Konstantin Burov and iandisme).
So, for example, if my device is 2.2, I use AndroidHttpClient , everything else uses DefaultHttpClient .
Of course, if I import the library, it will give me an error on any device from 1.5 to 2.1.
Any suggestions would be greatly appreciated because in the future I would like to set other settings based on the API.
source share