How do I know where my app received an ANR

by idev » Wed, 01 Apr 2009 16:02:59 GMT

Sponsored Links

Is there a way of finding out where my app threw an ANR (Application
Not Responding). I took a look at the traces.txt file in /data and I
see a trace for my application. This is what I see in the trace.

"main" prio=5 tid=3 TIMED_WAIT
  | group="main" sCount=1 dsCount=0 s=0 obj=0x400143a8
  | sysTid=691 nice=0 sched=0/0 handle=-1091117924
  at java.lang.Object.wait(Native Method)
  - waiting on <0x1cd570> (a android.os.MessageQueue)
  at java.lang.Object.wait(
  at android.os.Looper.loop(
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(
  at dalvik.system.NativeStart.main(Native Method)

"Binder Thread #3" prio=5 tid=15 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x434e7758
  | sysTid=734 nice=0 sched=0/0 handle=1733632
  at Method)

"Binder Thread #2" prio=5 tid=13 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x433af808
  | sysTid=696 nice=0 sched=0/0 handle=1369840
  at Method)

"Binder Thread #1" prio=5 tid=11 NATIVE
  | group="main" sCount=1 dsCount=0 s=0 obj=0x433aca10
  | sysTid=695 nice=0 sched=0/0 handle=1367448
  at Method)

"JDWP" daemon prio=5 tid=9 VMWAIT
  | group="system" sCount=1 dsCount=0 s=0 obj=0x433ac2a0
  | sysTid=694 nice=0 sched=0/0 handle=1367136
  at Method)

"Signal Catcher" daemon prio=5 tid=7 RUNNABLE
  | group="system" sCount=0 dsCount=0 s=0 obj=0x433ac1e8
  | sysTid=693 nice=0 sched=0/0 handle=1366712
  at Method)

"HeapWorker" daemon prio=5 tid=5 VMWAIT
  | group="system" sCount=1 dsCount=0 s=0 obj=0x4253ef88
  | sysTid=692 nice=0 sched=0/0 handle=1366472
  at Method)

----- end 691 -----

How can I find out where the problem is?



How do I know where my app received an ANR

by dillirao malipeddi » Wed, 01 Apr 2009 19:15:00 GMT

 You must not run any complex operations on main thread
like i/o , or network operations

for those operations use separate thread , otherwise it will cause ANR

Dilli Rao. M


Sponsored Links

Other Threads

1. Launch an app from within the native Contacts app

I would like to be able to launch my app using a URI scheme rather
than an StartIntent. The idea is to be able to embed this "link" in
other apps for example inside a Contact as a URL. clicking on the URL
from within the contact should open my app. Is this possible?

On iPhone, an app can declare a "scheme" for itself in a plist file,
and when any link that starts with "scheme://" is clicked anywhere on
the phone, this will be translated by the OS as a launch request for
this app. Anything similar on Android?


2. Start Activity With Long Press of Home Key

I am writing an app that will replace the functionality of the dialog
displayed when performing a longpress on the home key and cannot
figure out how to get my activity this way.

I have spent the last week searching through the SDK, Google Groups,
and normal google searches to try to find the solution to this, and I
just can't find anything.

I should just have to come up with the correct recipe for intent-
filters, right?

Any insight would be greatly appreciated!  Thanks in advance!

3. submit html form

4. How do i read multiple checkboxes

5. Custom View blocking other views in layout

6. enable StreetView

7. Change an app