I'm developing an application in Android native application layer.
I was originally developing it for ICS, but now I've to port the same code base to GingerBread as well.
During the implementation for ICS, I've used the hidden classes of ICS, but these classes are not present in GingerBread.
I want to keep the same code base for both the versions(ICS and GingerBread).
Is there a way wherein I can leave out few classes when compiling the source code for GingerBread and include them when I need it for ICS?
When supporting multiple API levels, you generally want to set the target API level to be as new as possible, and the minimum to be the lowest one you want to support. You can then load code dynamically, so you won't need to compile different versions of your app.
The official developer resources have an excellent article on the subject: http://developer.android.com/training/basics/supporting-devices/platforms.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With