On Jun 9, 11:36 pm, Gavin Bong <[EMAIL PROTECTED]> wrote:
> The client is complaining that "It is unable to start Service with
> intent ...".

There is no restriction on access to components across .apks, so I
would guess that the Intent you are making is not matching the service
you have declared.  If you are using an explicit component name in the
Intent, make sure that the package name matches the package name of
the .apk the service is actually implemented in (in addition to the
class name matching).

(Btw, in a future SDK, if you don't have an <intent-filter> tag in the
service definition, application components will be private by default,
and there will be an attribute you can use to make them accessible
from other .apks.)

> Can inter-app communication be achieved via the aidl facility ?

Yes, see the RemoveServiceBinding example here:
http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/app/

The client and server there can be split across .apks and work exactly
the same way; you just need to compile the same .aidl definition into
both of the .apks.

> Is there an API to peek into the Service registry of android e.g. to
> enumerate all available services ?

You can't directly get a list of all services, but you can use this to
get all services matching an Intent:

http://code.google.com/android/reference/android/content/pm/PackageManager.html#queryIntentServices(android.content.Intent,%20int)

Or you can use these APIs to iterate through all .apks:

http://code.google.com/android/reference/android/content/pm/PackageManager.html#getInstalledPackages(int)

And then retrieve the services in each .apk by calling this:

http://code.google.com/android/reference/android/content/pm/PackageManager.html#getPackageInfo(java.lang.String,%20int)

With this flag:

http://code.google.com/android/reference/android/content/pm/PackageManager.html#GET_SERVICES

--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to