I know that android version 2.1 and below do not support GLES20. My code can run with both the fixed function pipeline (GLES1.x) and the programmable pipeline (GLES20) based on runtime determination of the version used by a android device and setting the GLES version accordingly.
My situation is that I would ideally like to keep my GLES20 code in my project and just not use the classes that use GLES20 at runtime when an android device of version <= 2.1 is detected. But when I set my project to 2.1 in Eclipse, GLES20 creates a compilation error. I assume that this is so because the Android2.1.jar does not contain GLES20 .
Is their a way I can keep my GLES20 code without getting compile errors when setting the android version lower and to just not use the GLES20 code at runtime, so that the running code will never use the GLES20 portions anyway.
Thanks
Okay, I figured out how. The element minSdkVersion and targetSdkVersion in the manifest allows this. I quote from the “Beginning Android Games” book. “This element allows us to deploy an application that uses APIs that are only available in newer versions to devices that have a lower version installed”. So I will use this element accordingly, and develope in eclipse with my target android version set. I’ll answer my question with this asap
The relevant documentation on Android developers, as linked by Mārtiņš Možeiko’s comment.
developer.android.com/guide/appendix/market-filters.html