Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个想要通过 AIDL 公开的现有 Java 接口。有没有办法从 Java 自动生成 AIDL?
我知道 Corba 代码的 Java2IDL,所以这将与此类似。
我认为这样做很难,因为 Java 和 AIDL 都是不同的语言。此外,您可能会通过 AIDL 接口发送和接收用户定义的类型,这需要在 AIDL 中进行额外处理。您需要为每个可解析类型创建一个单独的 AIDL 文件。
据我所知,没有这样的工具。但是,由于aidl 与java 接口不同,因此程序员应该做出一些决定。这就是为什么这些工具更有可能不会出现的原因。