If we are really talking about an Android project (folders with source .java files and all the necessary XML files, etc.), just right-click the project folder and click Properties. In the properties window, select the section Androidin the left pane. Now just select the project creation goal that you want to use and click Apply.
EDIT: If you want to ensure backward compatibility of some functions, just check the SDK version and decide what to do with the version of the SDK version of the specific version.
int sdk = new Integer(Build.VERSION.SDK).intValue();
if(sdk >= 5) {
}
else {
}
source
share