1. Are you ready for the Galaxy S20? Here is everything we know so far!

Intercepting intents

Discussion in 'Android Development' started by t0ol, May 31, 2010.

  1. t0ol

    t0ol Lurker
    Thread Starter

    Hi all,
    is there a way to view all the intents coming from a specified 3rd party service for example (so i dont know any of intents parameters)? if yes - what filters should be used?

    lets say i want my prog to know that gtalkservice has just received a message.. i guess gtalkservice sends an intent to the notif manager and the gtalk activity itself passing the incoming msg..

    or maybe there is a way to make notification manager tell me that it has received an event from app XYZ?

    l3oy_in_l3lack likes this.
  2. KlaymenDK

    KlaymenDK Android Expert

    Welcome to the forum! :D

    No, unfortunately (as far as I have been able to read from the docs) you have to know the action (URL) at code-time. :(

    That's why there is a need for a site like "OpenIntents.org", so that there is a place to publish and coordinate intents.
    The list of built-in Intents (listed under "Standard Activity Actions" in the Intent documentation) is surprisingly short.

    IMVHO it's a very sad situation that OI is even necessary: Android really ought to have included a built-in feature to query available intents/activities at run-time and process them dynamically. :rolleyes:
  3. t0ol

    t0ol Lurker
    Thread Starter

    hm. then how does the app "trackball alert pro" works?

    it actually can intercept intents... or somehow else.

    if u put it into debug mode it can write all passing events in the log.
    i know it modifies framework.jar but still i cant understand how is it implemented
  4. KlaymenDK

    KlaymenDK Android Expert

    I can't say; my Galaxy doesn't have a trackball and I haven't looked at the source for that app (assuming it's available).

    Are you sure the app is really intercepting the intents, as opposed to merely displaying some runtime log?
  5. t0ol

    t0ol Lurker
    Thread Starter

    i donno how it is done. its a donate app so i guess source is not available =)

    if it doesnt intercept then how can it handle some apps that are not in api
    like the mentioned gtalk?

    in debug state it logs custom event to a file. i was setting the trigger for gtalk like that - set the prog to debug (i assume it launches broadcast receiver for like all intents..), make the event appear (message urself), event logs to file, enter the string with the desired event com.name from log in the app, done.

Share This Page