Hi,

Question: How do I track changes in the list of running application
processes most effectively?


A little explanation:

I'm new to Android development and I have a question about keeping
track of other application's statuses.

The application I'm writing will contain a list with names of "known"
applications. As soon as one of these applications is started, my app
should be aware of that.  If this application is no longer active, my
app should know it as well.

So far I've done a little experiment to get a simple list of running
application processes, a simple Activity that shows the output of
"activityManager.getRunningAppProcesses()".


What I want is a more automated approach; my application isn't even
supposed to have a GUI.

- I've been experimenting with starting a service at boot time that
could poll periodically for a list of running app processes. This
implies that this service is running at all times!
I'd suppose that this approach is too inefficient, causing way too
much overhead and power consumption?

- I've been looking for an event-based model that sends an event to
all its listeners as soon as the list of running apps has changed. But
I couldn't find anything like that (yet)?

- I've been thinking about Intents: the applications I want to track
are all of the same type (e.g. video players). But some of them may be
closed source and/or pass Intents explicitly. So I've got no idea if
it's even possible to do anything this way...

- ... [ any other approaches?] ...



Thx for your advice!

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