Android - how to add @hide annotation in my project

后端 未结 1 893
春和景丽
春和景丽 2020-12-09 23:03

I\'m developing SDK, and I would like to use @hide annotation for methods/classes which I don\'t want to be visible for the user who uses my SDK. (same as in Activity implem

相关标签:
1条回答
  • 2020-12-09 23:56

    In Android SDK, the @hide annotation is only used when building the stub version of android.jar. At compile-time symbols are imported from this stub jar and only non-hidden symbols are available. At runtime in device or emulator the symbols are there in the platform libraries and they can be seen for example via reflection.

    If your SDK only consists of a jar file or something similar, there really isn't a way to hide symbols in it.

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