Programming for specific Android versions
<p>I have a question concerning Android programming. I intend to programm an application for Androiod 2.2 and above (including tablets). Problem, I am facing, is, that various version have different API news, e.g. Download Manager is fully implemented for the first time in 2.3, in 2.2 I have to programm it manually. I am thinking of building my app from modules, where each of them would be for particular Android OS version. You can imagine it as main app and depending on actual OS, it triggers Android 2.3 API Download Manager or (in case of 2.2) it starts my custom download manager, I have made. </p>

<p>Problem is, how to solve it in code? Because, when I enter to my 2.2 project .java file with Download manager import and code with it's usage, I cannot build application. I have found DexClassLoader solution, where I install only core of an app and other "modules" I will read from external sources depending on API level of current device. It sounds to me like "dirty" approach, isn't there anything "cleaner" how to solve particular pieces of code, which differs according to API level?</p>

<p>Thank ya</p>
