部署导入我的类的 AIDL
我必须让其他开发人员能够连接到我的服务,但我的 AIDL 导入了我的类。 我不想给他们服务的源代码,只是 APK 和某种存根文件(java、jar?)。 我怎样才能给他们一些东西——“粘合剂”——让他们使用我的 AIDL 中的类并使用服务 akp 而无需获取服务的来源?
感谢您的任何提示!
I have to make other developers to be able to connect to my service, but my AIDL imports my classes.
I don't want to give them the source code of the service, just the APK and some kind of a stub file (java, jar?).
How can I give them something - "the glue" - which makes them to use the classes in my AIDL and using the service akp without getting the sources of the service?
Thanks for any hints!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果“我的类”是指您自己的实现
Parcelable
的类,请从您的 API 中删除它们。恕我直言,唯一稳定的远程服务 API 是那些完全依赖于操作系统提供和管理的东西的 API。这意味着您必须坚持使用 Android 提供的原语、列表/映射和
Parcelable
类(例如,Bundle
、PendingIntent
)。否则,您必须将源代码发送到您的
Parcelable
类,然后在您决定更改这些类实现时处理兼容性问题。但是,如果“我的课程”指的是其他内容,您可能希望编辑您的问题并进一步解释您的意思。例如,您可以发布 AIDL 文件。
If by "my classes" you mean your own classes that implement
Parcelable
, get rid of them from your API.IMHO, the only stable remote service APIs are ones that depend solely on things supplied and managed by the operating system. That means you stick to primitives, lists/maps, and
Parcelable
classes supplied by Android (e.g.,Bundle
,PendingIntent
).Otherwise, you have to ship the source code to your
Parcelable
classes, then deal with compatibility issues should you ever decide to change those class implementations.If, however, "my classes" refers to something else, you may wish to edit your question and explain a bit further what you mean. For example, you might post the AIDL file.