简体   繁体   English

最低sdk是否过低(如8 sdk)有什么影响,目标sdk越过sdk(如23 sdk)?

[英]There is any impact of minimum sdk is too lower level (as 8 sdk level) and target sdk is higher sdk level (as 23 sdk level) ?

Is there any impact of lowest (minimum sdk) and highest (target sdk) levels in the android project. android项目中最低(最低sdk)和最高(目标sdk)级别有什么影响? Is these things may effect the project reliability and efficiency. 这些事情是否会影响项目的可靠性和效率。

There is no impact, If you target SDk level 8 then your app will target 99.8 % of the mobiles make sure you use V7 support jar to make you development process easier. 没有影响,如果您以SDk 8级为目标, 那么您的应用将以99.8%的手机为目标,请确保您使用V7支持jar简化开发过程。 Since no new popular mobiles have 23 yet you can target it to be ready for the future but Make sure you dont add unwanted permissions as it will make you life difficult also ensure you handle the scenario if permission is declied . 由于尚无新的流行手机有23种,因此您可以将其定位为将来使用,但请确保不要添加不需要的权限,因为这会使您生活困难,并且如果权限被拒绝,则请确保您能够处理此情况

Yes, the targets are there to filter out what your app caters to which android versions. 是的,目标是可以过滤出您的应用程序针对哪些Android版本的。 Different SDK levels has different set of new/updated APIs and depreciated APs. 不同的SDK级别具有一组不同的新/更新的API和已贬值的AP。

The lower u go , the more devices you are able to target. 越低,您可以定位的设备越多。

More info: https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels 更多信息: https : //developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels

The impact is only in what features you are able to use. 影响仅在于您可以使用哪些功能。 For example API 8 doesn't support animations that were introduced in Honeycomb, API 22 doesn't support the optional permissions introduced in Marshmallow etc. 例如,API 8不支持Honeycomb中引入的动画,API 22不支持棉花糖等中引入的可选权限。

It is still possible to use these features in your app using the TargetApi annotation, but you have to be sure that they will not be run on older devices, usually by using a statement such as this: 仍然可以使用TargetApi注释在您的应用程序中使用这些功能,但是您必须确保通常不会通过以下语句在旧设备上运行这些功能:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
{
    // JellyBean specific code goes here
}
else
{
    // Pre-JellyBean code goes here
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM