简体   繁体   English

Android如何导入不在公共SDK中的库

[英]android how to import libraries not in public sdk

In android studio how I can import libraries not in public SDK such as android.os.ServiceManager ? 在android studio中,如何导入不在android.os.ServiceManager公共SDK中的库? there exist any command that I can write in gradle files to fix this problem? 我可以在gradle文件中编写任何命令来解决此问题吗?

The ServiceManager which is part of android.jar is marked with the @hide annotation. 属于android.jarServiceManager带有@hide注释。

In design time, all classes, enums, fields and methods marked with hide annotation are exclude in the android.jar, although in runtime android load framework.jar (equivalent to android.jar) which contains also the classes, methods, enums and fields marked with the hide annotation. 在设计时,所有标记有hide批注的类,枚举,字段和方法都被排除在android.jar中,尽管在运行时android load framework.jar(相当于android.jar)也包含类,方法,枚举和字段标有hide注释。

Although, you can access in design time using reflection or building the android.jar with theses classes inside it. 虽然,您可以在设计时使用反射来访问,或者使用其中的这些类构建android.jar。

Take into consideration you cannot publish your app on Google Play because you are in breach of EULA. 考虑到您违反了EULA,因此无法在Google Play上发布您的应用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM