如何将一个 Android 应用程序中的 API 公开给另一个应用程序
我想编写一个应用程序,该应用程序将作为服务在 Android 设备上运行,然后与其他应用程序一起通过调用访问该服务。 有没有办法从 Android 设备上的应用程序/服务公开公共 API?以及如何从另一个应用程序访问此 API?
感谢您的帮助
I would like to write an application that would run on the Android device as a service and then with other application(s) I would access to this service with calls.
Is there a way to expose public API from an application/service on the Android device? And how to access this API from another application?
Thanks for help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
研究意图、AIDL(绑定器)和内容提供者。
意图是小的“简单”异步消息,AIDL 如果用于更多 RPC 类型的 API,则对于更复杂/更多数据的 API 很有用。内容提供者是从应用程序公开数据的一种方式,例如联系人列表或其他内容。
Look into Intents, AIDL (binder) and content providers.
Intents are smal "simple" asyncronius messages, AIDL if for a more RPC type of API, usefull for a more complex/more data API. Content providers are a way to expose data from your App, like a contact list or something.