Running/Start time of android application/process?

by vishnu kumarraju » Sat, 12 Feb 2011 05:51:09 GMT


Sponsored Links
 I'm new to android,  my requirement is to display active process
running with process start time.
I'm able to get the list of running process name/ID's with the below
code, but couldn't able to find how long process is running.

Here is my code sample.


                List l = activityManager.getRunningAppProcesses();
                        Iterator i = l.iterator();
                PackageManager pm = this.getPackageManager();

while(i.hasNext()) {
                  ActivityManager.RunningAppProcessInfo info =
(ActivityManager.RunningAppProcessInfo)(i.next());
                  try {
                    CharSequence c =
pm.getApplicationLabel(pm.getApplicationInfo(info.processName,
PackageManager.GET_META_DATA));
                    Log.w("LABEL :::", c.toString());

                  }catch(Exception e) {
                    //Name Not FOund Exception
                  }


Can you suggest me is there any class I need to look into it?  It
would be great help if some one can help me with sample code. Thanks
in Advance.

Thanks & Regards
Vishnu.K

-- 



Other Threads

1. 1.5 ListView disabled items

Hi all , i've noticed after i've switched to 1.5 that if ListView item
is not enabled the divider(s) for this item are not rendering. Is this
intentional ?
--~--~---------~--~----~------------~-------~--~----~

2. AppWidget issues

I'm taking a swing at quickly producing a fully fledged AppWidget that will
augment my forthcoming Daisy Chase game. I've encountered a couple of
issues.

There's one definite bug: AppWidgetProvider fails to
handle ACTION_APPWIDGET_DELETED actions properly. Browsing the source I can
see that AppWidgetService broadcasts an ACTION_APPWIDGET_DELETED Intent with
an EXTRA_APPWIDGET_ID, but the AppWidgetProvider is only looking
for EXTRA_APPWIDGET_IDS. The result is that you never receive a call
to onDeleted().

The workaround is simple: don't use AppWidgetProvider, but the question is
which end is wrong? Nothing is specified in the docs as far as I can tell.
Do we need to watch out for either extra for both updates and deletions?

Additionally (and I haven't investigated this yet) there appears to be a
possible deficiency in the timeliness of ACTION_APPWIDGET_UPDATED
broadcast cessation. If my debug output is to be believed, what I am seeing
is that the deletion is broadcast but I continue to receive update events
for the deleted widget until I add another widget from the same provider;
that is, I remove my widget on the home-screen and continue to receive
updates for it (indefinitely it seems) until I add another.
The second issue I've encountered probably isn't a bug, but I can't work out
the expected behaviour. My widgets contain an ImageView. The image is small
(80x80) and updates every hour. I decided that the most efficient approach
would be to write a ContentProvider that serves pngs of the widget images
from disk via openFile(). My RemoteViews for each widget then queues a
setImageURI call with the appropriate content URI.

This works up-to a point. The problem is that when the widget is updated and
a new image is generated, how can I kick the ImageView into reloading the
image? The obvious solution which I expected to work, was to push another
RemoteViews object (new instance - identical layout) to the AppWidgetManager
but that doesn't work. The image is not requested again. What is causing
this, over-aggressive optimization in the handling of RemoveViews by the
widget framework, or something else?

(Again the workaround is simple: decorate the Uri with something distinctive
like a timestamp so that the Uri is unique on each request.)

Tom

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

3. Animation Xml Resource and CycleInterpolator tag: FAIL

4. AppWidgets: Dynamic value for updatePeriodMillis?

5. AppWidgets: Dynamic value for updatePeriodMillis?

6. httpclient -> http.client

7. The cell line color of GridView