Hi Dianne,
Thanks for the reply. Actually here is what I want to do:
On the service side (C code), reusing binder.c in the service_manager
directory. So my code will call
1. binder_open,
2. bio stuff to build an io block for adding service,
3.binder_call to add service to service_manager.
4. binder_loop to wait for requests. (Just do a quick prototype here, so no
multi-threads)

On the client side (java), send request to the service I built and receive
replies.
Now, if I run /system/bin/service list, I can see my service like this:
# /system/bin/service list
Found 43 services:
0    Binder.Test.IBindertest: []

But, on the java side, I can not really get the binder object for this
service. The bindService call failed with following error messages:
W/ActivityManager(  581): Unable to start service Intent {
action=Binder.Test.IBindertest }: not found

Yi

On Mon, Mar 30, 2009 at 10:01 PM, Dianne Hackborn <hack...@android.com>wrote:

> If you are writing a low-level system service, the high-level Service API
> (onBind() etc) is irrelevant.  The aidl stuff is part of the primitive
> Binder IPC stuff; Service is a much higher-level facility built on top of
> it.
>
>
> On Mon, Mar 30, 2009 at 7:21 PM, beyounn <beyo...@gmail.com> wrote:
>
>>
>> Ok, let me try out the AIDL part, it seems simpler. But I do have a
>> question about it and hope you could give more hits. I took a look on
>> the AIDL, it seems that on the service(server) side, we have to
>> implement onBind and other methods. For my case, does it mean that I
>> don't need to care about the service side works and only need to
>> implement something like RemoteServiceBinding.java in the example code
>> for my self?
>> Thanks
>> Yi
>>
>> On Mar 30, 6:36 pm, Dave Sparks <davidspa...@android.com> wrote:
>> > You can write AIDL to generate your Java binding, or you can write
>> > your own native binding and put a JNI layer on top of that. If you
>> > don't plan on calling your service from native code, AIDL is much
>> > easier.
>> >
>> > On Mar 30, 6:08 pm, beyounn <beyo...@gmail.com> wrote:
>> >
>> > > Hello,
>> > > I'm writing a service by C. My code calls binder to add a service
>> > > called "myservice" into servicemanager. And I can add "myservice"
>> > > without any problem. Also, when I run "/system/bin/service list", it
>> > > shows the service added by me. The question is -- What is the correct
>> > > way to access this service from my application that is written by
>> > > java?
>> > > Thanks
>> > > Yi
>>
>>
>
>
> --
> 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.  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-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to