what is a non-SDK interface

前端 未结 1 951
广开言路
广开言路 2021-02-03 21:29

After searching new Android P features, I came across the non-SDK interfaces restriction. and my question is,

What is a non-SDK interface or an SDK interface? What is th

1条回答
  •  别跟我提以往
    2021-02-03 22:08

    Quoting the documentation:

    Generally speaking, SDK interfaces are those ones found documented in the Android framework Package Index.

    Not everything in the framework appears in the documentation. Classes, methods, fields, and such marked with @hide in the source code are available at runtime but are not part of the SDK and do not appear in the documentation. These items can only be accessed by unconventional means, such as reflection.

    That is what Android P is starting to ban.

    For years, I have been advising developers not to access such things, because they are unreliable. Any Android device may not have the hidden stuff, due to changes based on the Android version or device manufacturer/ROM modder tweaks. Now, Google is going to enforce this advice more firmly, at least in some cases.

    specially that makes non-SDK once better

    They are not "better". However, they may offer access to certain features that are not available in the SDK, for one reason or another (e.g., API is not settled yet).

    0 讨论(0)
提交回复
热议问题