Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Leave out classes during compile time

Tags:

android

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?

like image 826
Sushil Kadu Avatar asked Nov 19 '25 04:11

Sushil Kadu


1 Answers

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

like image 175
Marcus Forsell Stahre Avatar answered Nov 20 '25 21:11

Marcus Forsell Stahre



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!