Er... you are sure that both .apks have different package names?  Anyway it
sounds like whatever problem you have has nothing to do with services
themselves, but just getting both apps installed at the same time?

On Sun, May 17, 2009 at 7:35 AM, dev_rob <robwiene...@googlemail.com> wrote:

>
> I now have the TestInterface.aidl in both eclipse projects and project
> 2 (the service project) is added to project 1's build path.
>
> I declared the service in the manifest-file with:
>
> <service android:name=".TestStringService"
>        android:exported="true"
>        android:process=":remote">
>        <intent-filter >
>                <action android:name="de.roberlin.new_rpc.action.NEW_RPC"/>
>        </intent-filter>
> </service>
>
> and "adb shell dumpsys package" shows it successfully registered to
> the emulator.
>
> I try to bind to the service with:
>
> "String intentAction = "de.roberlin.new_rpc.action.NEW_RPC";
>                        Intent iService = new Intent(intentAction);
> bindService(iService, myService, Context.BIND_AUTO_CREATE);
>
> DDMS won't stop telling me:
>
> "05-17 14:14:34.285: WARN/ActivityManager(567): Unable to start
> service Intent { action=de.roberlin.new_rpc.action.NEW_RPC }: not
> found"
>
> In fact, after running project 1 (the activity binding to the service)
> and getting the error message, when I do
>
> "adb shell dumpsys package"
>
> again, it does not list my service anymore. how can this be???
>
> the steps were:
>
> 1.) installing the service onto a new emulator ("adb shell dumpsys
> package" lists it then correctly)
>
> 2.) installing/running project 1 (leads to the error message above)
>
> 3.) now "adb shell dumpsys package" does not list the service anymore.
> even if i reinstall it, it won't be listed anymore until I start a new
> emulator and intall it freshly.
>
> I really do not know, how to deal with this and would be really
> thankful for any help!!
>
> best regards!
>
> On 17 Mai, 08:25, Dianne Hackborn <hack...@android.com> wrote:
> > For the second question, you'll either want to define an abstract action
> in
> > an intent-filter for the service and use that as the intent you bind to
> > (typically the action is the name of the desired interface for binding to
> > services), or create an explicit ComponentName with the package name +
> class
> > name of the service being bound to and provide that to the Intent.  For
> this
> > latter, make sure you have set android:exported="true" for the service.
> >
> > Sorry I can't really help you with the first question, since I don't know
> > ADT that well.  Basically you will need to have both applications like
> the
> > generated aidl code into their app.
> >
> >
> >
> > On Sat, May 16, 2009 at 8:46 AM, dev_rob <robwiene...@googlemail.com>
> wrote:
> >
> > > 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!
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.
> >
>


-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

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

Reply via email to