如果我使用的目标SDK版本是21,我可以在API 23上运行我的应用程序吗 [英] Can I run my app on API 23 if target SDK version I used is 21

查看:129
本文介绍了如果我使用的目标SDK版本是21,我可以在API 23上运行我的应用程序吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发了一个以API 21作为目标SDK版本的Android应用.

I have developed an Android App having API 21 as target SDK version.

它可以在上面的API(例如API 23)上正常运行吗?

Will it run fine on API above it, for example, API 23?

推荐答案

使用targetSdkVersion并将其安装在具有更高SDK版本的设备上是完全可以的.

It is perfectly ok to use a targetSdkVersion and install it on a device that has a greater SDK version.

您在build.gradle中指定的targetSdkVersion告诉系统您已经开发并测试了可在该SDK上运行的应用程序. 如果用户在更高的SDK上安装您的应用,则系统责任是提供向后兼容性(如果发生任何更改).

The targetSdkVersion that you specified in your build.gradle tells the system that you have developed and tested your app to work on that SDK. If the user installs your app on a greater SDK it is the system responsibility to provide backwards compatibility (if anything has changed).

一个很好的例子是SDK 23上的权限发生了什么.由于该版本必须在代码中显式地请求危险的权限,仅在清单中声明权限已不再足够.

A good example is what happened with the permissions on SDK 23. Since that version it is necessary to explicitly request for dangerous permissions in code, just declaring the permission in the manifest is no longer sufficient.

但是,如果将此应用定位到SDK22,则不需要通过代码显式请求,并且如果将此应用安装在更大的SDK系统上,则由于向后兼容(在这种情况下为在安装时接受所有权限.

However, if you target this app to SDK22, it is not required to request explicitly by code, and if you install this app on a greater SDK system, it will work, because of the backward compatibility, which in this case is to accept all the permissions at install time.

这篇关于如果我使用的目标SDK版本是21,我可以在API 23上运行我的应用程序吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆