How does 2 different package share the same aidl interface?

by payre...@gmail.com » Fri, 17 Jul 2009 01:53:47 GMT


Sponsored Links
 Hi Android Developers,

I would like to ask you how do I access an remote service from an
application which is in a different package.

e.g.  remote service is in the package: com.android.appService
       application is in the package com.applications.sampleApp

I have gotten to the stage where the application is able to create and
start the service, but when I try to call one of the methods
implemented in the application service, i get an error that looks like
the following:

W/Parcel  (  319): **** enforceInterface() expected
'com.android.appService' but read
'com.applications.sampleApp'

Currently, the same aidl file is both packages to prevent linking
errors, but it looks like the application is trying to call the method
stub from the aidl in the application package. What I'm confused is
that, when I do the bindservice, the instance of the service should be
returned to the application, and any method calls should be directed
to service aidl stubs rather than the application aidl stub.

I found a thread that had a similar problem, but that thread ended
without an obvious resolution.

Please advise on this problem that I'm facing.

Many thanks,
Peter

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Recent Apps change in 2.2 - Brings main Activity to foreground, not the last visible one

The recent apps display seems to function quite differently from
earlier versions on 2.2.

Try the following for instance:
1) Open an app
2) Click on something that takes you to another activity in the same
app
3) Press the home button
4) Press and hold the home button to get the recent list of apps -
select the app you chose in step 1
5) You'll be taken to whatever activity in that app is specified as
the main/launcher Activity, rather than the Activity on top of the
stack (as it was previously)

It makes it appear to the user that the application has exited when
the home screen button was pressed.

I don't have my app set to clear history on launch or anything like
that, and I can replicate it on the emulator and with any app on my
device (Contacts, Gmail, Engadget etc)

Anyone else notice this? Anyone know any reason for the changes? I
must admit I quite dislike the new method.

-- 

2. SQLiteOpenHelper per activity??

Do I need an instance of my SQLiteOpenHelper class for each Activity I have?
 I have 1 currently that all activities access, but started getting an
exception

"illegal state exception SQLiteDatabase created and never closed "

on simple a simple query and I can't seem to figure out why this is
happening.  I read online about this, and wanted to try to understand why
the SQLiteOpenHelper was dependent on an Activity.

Is there a way to just have open SQLiteDatabase object without the Helper
and have it just exist within all activities?

Thanks

-- 

3. How to override the <ENTER> key behaviour of the virtual keyboard in Android

4. java.lang.IllegalStateException: Content has been consumed

5. R cannot be resolved

6. How could I avoid others to get my used pictures in my application?

7. How do you approach the various devices your application runs on?