I have a Remote Service that I would to offer to other programmers as an apk. This Remote Service offers an API to control the service. I have written a test application in a different package to test my Remote Service. It does not work since the AIDL must be exported to my test application. Of course I can put my Remote Service on the build path but that is not what I want. I want other programmers to be able to use my API in their applications by just installing the apk on the smartphone. I do not see another solution but distributing my Remote Service as a jar and not an apk.
I once read a piece of code with an Intent that automatically opened a download page for an apk if the Intent could not be started. However, if I work with Remote Services the AIDL must be always 开发者_如何学Goimported to the application that wants to use my remote service, or am I wrong?
Thanks, Benny
If the association is fairly loose, you may be able to use intents as a communication mechanism rather than the service binding model.
If keeping the present module, you could provide the necessary AIDL code as source or a jar for other programmers to incorporate. If you do this, put some versioning in your interfaces and some thought into how incompatible versions should be handled. This is really not that far from how most re-usable component mechanisms work - stubs for the re-usable external module must be provided to support compilation of the client program.
精彩评论