Note that the only thing listed there that is part of the SDK is
getRunningAppProcesses().  Using the "top" command is not part of the SDK,
and you should expect such code to break.

Also both of these are pretty wretched things to do, since they require
retrieving a parsing a bunch of information.  Beyond that writing code that
does polling for information is strongly discouraged, using polling to
retrieve this information is even more undesirable.

The platform deliberately does not provide easy mechanisms to do this,
because monitoring what the user is doing is not something to encourage.
 You haven't said why you want to do this, but I would discourage you from
whatever path you are going down here.

On Tue, Jun 26, 2012 at 5:53 AM, Francisco M. Marzoa Alonso <
[email protected]> wrote:

> Hi,
>
> I have found the link, published by Nobu the day before yesterday:
>
>
> http://www.javachartingandroid.com/2011/04/android-get-application-process-cpu-usage-and-memory-usage/
>
> Best regards,
>
>
>
> On 26/06/12 14:04, Narendra Singh Rathore wrote:
> > Hi all,
> >
> > I want to know if it is possible to detect an application launch, through
> > its package name.
> >
> > Suppose, I have created a test app, in which I want to get some
> information
> > about a specific app,
> > For eg. Contact app of the device....like how many times it has opened or
> > closed, in a specific amount of time.
> >
> > I want to store the information (say, in database) when that app has just
> > been launched (of course, on the same instant).
> > I want all that by providing package name of that application.
> >
> > Is all what I want possible?
> > If yes, how to do that?
> >
> > I guess, I need to use BroadcastReceiver for this. What do you say?
> >
> >
> > Thanks n Regards,
> > NSR
> >
>
>
> --
> 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
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  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 [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