I want to develop an Android application even for android devices with a lower version, while I do not want to sacrifice some available functions in higher versions.
In the AndroidManifest.xml file:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
I get the android level of the current device:
deviceLevel = android.os.Build.VERSION.SDK_INT;
Then I will use if statements to specify different code for different versions.
if (deviceLevel >= 11)
{
List<Camera.Size> videoSizes = parameters.getSupportedVideoSizes();
......
}
else
{
......
}
However, Eclipse indicates there exists errors. getSupportedVideoSizes is not availabe for version = 8;
I think I need to suppress the error at this situation. How to do that?