You are calling on an interface that is different than the actually interface being called on the back-end service.
The remote service API demo should show you how to do this correctly. On Tue, Jan 13, 2009 at 10:20 AM, rktb <yend...@pv.com> wrote: > > Bumping it up ... > > On Jan 13, 12:39 pm, rktb <yend...@pv.com> wrote: > > Hi, > > > > I could not find "Reply" on the post: > http://groups.google.com/group/android-developers/browse_thread/threa.... > > So, creating a new post. > > > > Based on Dianne's example, I am able to start a remote service and > > also call "bindService". Now, when I am trying to call a method, I am > > seeing the following problem: > > ~~~~~~~~~~ > > W/Parcel ( 319): **** enforceInterface() expected > > 'com.android.rkserv.IRKOwnService' but read > > 'com.android.rkapp.IRKOwnService' > > D/AndroidRuntime( 342): Shutting down VM > > W/dalvikvm( 342): threadid=3: thread exiting with uncaught exception > > (group=0x4000fe68) > > E/AndroidRuntime( 342): Uncaught handler: thread main exiting due to > > uncaught exception > > E/AndroidRuntime( 342): java.lang.SecurityException: Binder > > invocation to an incorrect interface > > ~~~~~~~~~~ > > > > The following are the details of my packages: > > > > Package "com.android.rkserv" consists of a service RKOwnService. It > > has the IDL file IRKOwnService.aidl. The AndroidManifest.xml consists > > of the service > > <service android:name=".RKOwnService" android:exported="true" > > android:process=":remote" > > > <intent-filter> > > <action android:name="com.android.RKINTENT" /> > > </intent-filter> > > </service> > > > > Package "com.android.rkapp" wants to access this service. > > The service is started via > > Intent serv = new Intent(); > > serv.setAction("com.android.RKINTENT"); > > startService(serv); > > > > The service is bound via > > bindService(new Intent("com.android.RKINTENT"),rkconn, > > Context.BIND_AUTO_CREATE); > > > > The service is stopped via > > Intent serv = new Intent(); > > serv.setAction("com.android.RKINTENT"); > > stopService(serv); > > > > All the above actions go through fine. Next, I try to call a function > > defined in the interface as > > private final IRKOwnService.Stub mBinder = new IRKOwnService.Stub > > () { > > public void callFn1() { > > RKOwnService.this.callFn1(); > > } > > }; > > This is when I see the error -- > > W/Parcel ( 319): **** enforceInterface() expected > > 'com.android.rkserv.IRKOwnService' but read > > 'com.android.rkapp.IRKOwnService' > > > > NOTE: To get rid of compilation errors, I added "IRKOwnService.aidl" > > in the calling package "com.android.rkapp". > > > > Any pointers would be appreciated. > > > > Thanks, > > Ravi > > > -- 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 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 -~----------~----~----~----~------~----~------~--~---