Hi android developers,

I'm new to the great android platform, trying to get into RPC with
aidl and services.

I didn't find a sufficient answer to my problem in any posts, if there
already is one, please excuse and point me to it, thanks.

I made 2 projects.

project 1 hast an activity that binds to a service from project 2 on a
button click (all just for testing).

1. issue:

How can I make project 1 know (import) my TestInterface (from
TestInterface.aidl out of project 2) for usage in:

"TestInterface mService = (TestInterface)
TestInterface.Stub.asInterface(service);"

without adding project 2 to the build path, because if I'd have an
installed service without the project code, I couldn't do it this way,
too...??
I read in one thread that TestInterface.aidl should just be added to
project 1, too, but if I do this, in DDMS enforceInterface() complains
and seems to just see/use the interface from project 1 and it doesn't
work.

2. issue:

(here i add project 2 to project 1's build path, which i still think
is not how it should work)

If i bind to a system service, i can simply do something like

bindService(new Intent(com.android.A_SERVICE);

but if i have my own service in project 2, something like

bindService(new Intent(com.project2.A_SERVICE);

does not work (of course, service 2 is installed on the emulator at
that point, i provide an intent-filter an set the "android:exported"-
attribute to true). the error i get is:

"05-16 15:06:06.384: ERROR/dalvikvm(820): Could not find method
de.roberlin.new_rpc.TestInterface$Stub.asInterface, referenced from
method de.roberlin.new_rpc.New_RPC_Client$2.onServiceConnected
"

this error makes really no sense to me, any suggestions?

btw: i ran "adb shell dumpsys package" and my Service is registered:

"Service Resolver Table:
...
Non-Data Actions:
      ...
      de.roberlin.new_rpc.action.NEW_RPC:
        436578f0 de.roberlin.new_rpc/.TestStringService"

The code from both projects can be reviewed at http://pastebin.com/f4bd0bc10

I hope my points (special concern lies on the error message..) are not
to nooby.

I'd really appreciate any help! Thanks in advance!










--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to