I need to use the In App Billing service in my app. I'm wondering if i can put the generated .java in a package and reference it instead of using IInAppBillingService.aidl.

In theory, couldn't it make the same communication with the service?

有帮助吗?

解决方案

Of course, you can use Java generated files instead of AIDL. Basically, AIDL interface is translated into java files during the compilation of your program and then is not used anymore. This pattern is used sometimes in Android platform programming (for instance, ActivityManager is not created from AIDL interface but there are separate java files that implement proxy and stub interfaces). I think that you can just take a generated java file from AIDL and put it directly in your service and client projects.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top