Targetsdkversion is to set the desired SDK version , if this property is set, then when the program executes, if the target device's API version is exactly equal to this value, he will tell the Android platform: This version of the program has been fully tested, no problem. It is not necessary to turn on compatibility check for this program.
That is, if the targetsdkversion is the same as the API version of the target device, it may be more efficient to run.
However, this setting is only a declaration, a notification, and will not have a substantial effect,
For example, a feature in the SDK version of Targetsdkversion is used, but this feature is not supported in the low version, so when running the program on a lower version of the API device, you may get an error: Java.lang.VerifyError. That is, this property does not help you resolve the compatibility test problem.
JS call Java, if set targetsdkversion, when targetsdkversion<17, no problem, targetsdkversion>=17 unsuccessful
If you are writing a HTML5 application and need to access the functions in Java in the JS code, you will use the WebView addjavascriptinterface () function. Because of security issues, JS can only access Java functions with @JavascriptInterface annotations in Android4.2 (if the applied android:targetsdkversion value is 17+).Before, any public function can be accessed in the JS code, while the Java object Inheritance relationship causes many public functions to be accessed in JS, one of the important functions is getclass (). Then JS can use reflection to access some other content. By introducing @JavascriptInterface annotations, you can access only the functions of @JavascriptInterface annotations in JS. This will enhance security.If your app has a android:targetsdkversion value of 17 or greater than 17, remember to add @JavascriptInterface annotations.
Android targetsdkversion @JavascriptInterface