android API 中提供的支持库是否是在旧设备上包含较新 android 版本功能的唯一方法?

Is the support library provided in the android API the only means to include the newer android version features on older devices?

google 如何通过支持库提供新的 android 功能以供旧 API 级别使用?

这取决于功能,如果它只涉及软件实现,那么已经有许多开发人员使用已经可用的本机组件为此类事情创建端口或解决方法

这可能因情况而异,取决于许多因素,包括 jvm 限制等

谈论您提供的两个 picture-in-picture (PIP) and notifications channel 参考资料 这些是在 Android O 中引入的,应该使用从 API 级别到更高级别,并且不支持,不幸的是,没有支持此功能的库。 对于通知,您不需要渠道,这是 Android 在 API 26 中的另一个功能,否则您的通知可能会被系统丢弃,以避免我们使用通知否则为背部支撑通道我们不需要这样的要求。

但支持的其他功能可用 Android Support Library

这里是 API 的完整 list 和 Android 中介绍的功能 O

i wonder if the newer android API features like picture in picture,notification channels can be used

具体针对那些功能?不会。这些功能的绝大部分工作是在您的应用程序和您的应用程序链接到的任何代码之外完成的。这项工作由核心 OS 流程完成。

can i include the code to be used for this features to work in lower API versions

具体针对那些功能?不。同样,大部分工作是在您的应用程序之外完成的。

较新 Android 版本中的某些 功能可以 "backported" 用于旧版本。大多数情况下,这是针对纯粹在您的应用程序链接到的代码中实现的功能。 Google 作为支持库的一部分提供某些功能的向后移植。其他功能可能会被其他开发人员向后移植,例如 my backport of Android 7.0's network security configuration。有时,更改太复杂而无法向后移植,或者没有人 "had the itch to scratch" 可以编写向后移植。