gpt4 book ai didi

android - android-n 预览中的 android sdk 有哪些变化?

转载 作者:行者123 更新时间:2023-11-29 14:36:26 24 4
gpt4 key购买 nike

我想知道 android-n 预览中的 android-sdk 变化是什么。

最佳答案

它们在发行和变更说明中列出。转向开放的 jdk 并删除关键方面的私有(private) API。

这可能对你影响最大:

Android N includes namespace changes to prevent loading of non-public APIs. If you use the NDK, you should only be using public APIs from the Android platform. Using non-public APIs in the next official release of Android can cause your app to crash.

In order to alert you to use of non-public APIs, apps running on an Android N device generate an error in logcat output when an app calls a non-public API. This error is also displayed on the device screen as a message to help raise awareness of this situation. You should review your app code to remove use of non-public platform APIs and thoroughly test your apps using a preview device or emulator.

If your app depends on platform libraries, see the NDK documentation for typical fixes for replacing common private APIs with public API equivalents. You may also be linking to platform libraries without realizing it, especially if your app uses a library that is part of the platform (such as libpng), but is not part of the NDK. In that case, ensure that your APK contains all the .so files you intended to link against.

Caution: Some third-party libraries may link to non-public APIs. If your app uses these libraries, your app may crash when running on the next official release of Android.

Apps should not depend on or use native libraries that are not included in the NDK, because they may change, or be removed from one Android release to another. The switch from OpenSSL to BoringSSL is an example of such a change. Also, different devices may offer different levels of compatibility, because there are no compatibility requirements for platform libraries not included in the NDK. If you must access non-NDK libraries on older devices, make the loading dependent on the Android API level.

引用:

关于android - android-n 预览中的 android sdk 有哪些变化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35899627/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com