It became clear now. Thank you Mark.
The problem was, I am having my AIDL interface in a different package.
And I have included the same AIDL interface package in both Service
and Client application. But  the   <intent-filter>  of the Service had
<action> string with package name of the Service.

So we can follow below while adding <intent-filter>, so trhat trick
"IScript.class.getName()" will work.

<service android:name=".serviceName" android:exported="true"
android:enabled="true">
<intent-filter>
<action android:name="package name of aidl interface.Interface name" /
>
</intent-filter>
</service>

thanks,
Krishna

On Jun 23, 7:02 pm, Mark Murphy <[email protected]> wrote:
> On Wed, Jun 23, 2010 at 9:57 AM, Krishna Shetty
>
> <[email protected]> wrote:
> > Thank you very much Mark, Joe.
>
> > But below call i.e., binding with the Interface name is not working. I
> > got the same error, "not able to bind, service not found.."
> > bindService(new Intent(IScript.class.getName()), svcConn,
> > Context.BIND_AUTO_CREATE);
>
> That means you have no service with an <intent-filter> containing an
> <action> string that matches the value generated by
> IScript.class.getName(). If you are taking that code from one of my
> samples, the corresponding manifest from those samples is set up
> properly:
>
> http://github.com/commonsguy/cw-advandroid/tree/master/AdvServices/Re...
>
> > But, below way of binding works. i.e., Binding with the exported
> > Service.
> > Intent i = new Intent();
> > i.setClassName("com.mt.TestRemoteService",
> > "com.mt.TestRemoteService.MyService");
> > bindService(i, svcConn, Context.BIND_AUTO_CREATE);
>
> This is extremely fragile. If the other application refactors its
> code, your code will break.
>
> > Why bind with Interface name is not working for me?
> > ( Note: I have added an <intent-filter> on the <service> with a
> > Interface <action> )
>
> Whatever you think you did, it is not working.
>
> Rather than use my IScript.class.getName() trick, it is probably
> simpler for you to just use the literal string. Copy whatever string
> is in your <action> and paste it as a string literal in your Intent
> constructor.
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.6
> Available!

-- 
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