<uses-sdk android:targetSdkVersion="16" android:minSdkVersion="8" />
minSdkVersion
, API.
targetSdkVersion
This is the highest possible SDK with which you can test, devices using your application will look and feel at home when this TargetSdk is high enough to allow.
multi-versions
If you want to use a function of a higher level than your minSdkVersion. you can block calls with Build.Version.X, for example.
File path;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
path = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath() + File.separator + directory);
} else {
path = new File(getBestCacheDir(applicationContext, true) + File.separator + "Pictures" + File.separator + directory);
}
Be careful not to use API functions of a higher level than your minSDK, as this will lead to a crash at runtime.
source
share