How do I know where my app received an ANR

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


Sponsored Links
 Hi

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.

DALVIK THREADS:
"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(Object.java:195)
  at android.os.MessageQueue.next(MessageQueue.java:144)
  at android.os.Looper.loop(Looper.java:110)
  at android.app.ActivityThread.main(ActivityThread.java:3742)
  at java.lang.reflect.Method.invokeNative(Native Method)
  at java.lang.reflect.Method.invoke(Method.java:515)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:739)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
  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 dalvik.system.NativeStart.run(Native 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 dalvik.system.NativeStart.run(Native 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 dalvik.system.NativeStart.run(Native 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 dalvik.system.NativeStart.run(Native 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 dalvik.system.NativeStart.run(Native 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 dalvik.system.NativeStart.run(Native Method)

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


How can I find out where the problem is?

Thanks.

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



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. Does ResultReceiver work across packages?

I have an activity in package A (SignerClient), and a service in
package B (MyService)

The activity's resultreceiver:

private ResultReceiver resultreceiver = new ResultReceiver(null) {
            @Override
            protected void onReceiveResult(int resultCode, Bundle
resultData) {
            ...
            }
        };

Starting the service:

Intent intent = new Intent("com.example.STARTSERVICE");
intent.putExtra("resultreceiver", resultreceiver);
startService(intent);

Receiving end:

 ResultReceiver rr = (ResultReceiver)
intent.getParcelableExtra("resultreceiver");

Doing this when client and server are in the same package works fine.
But in this case i get:

FATAL EXCEPTION: IntentService[MyService]
android.os.BadParcelableException: ClassNotFoundException when
unmarshalling: com.example.cryptoclient.SignerClient$1
at android.os.Parcel.readParcelable(Parcel.java:1883)
at android.os.Parcel.readValue(Parcel.java:1771)
at android.os.Parcel.readMapInternal(Parcel.java:2008)
at android.os.Bundle.unparcel(Bundle.java:208)
at android.os.Bundle.getParcelable(Bundle.java:1100)
at android.content.Intent.getParcelableExtra(Intent.java:3396)
at org.axades.service.MyService.onHandleIntent(MyService.java:28)
at android.app.IntentService
$ServiceHandler.handleMessage(IntentService.java:59)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.os.HandlerThread.run(HandlerThread.java:60)

What am I missing? Is my idea even possible?

-- 

2. "MiB" in "Create new Android Virtual Device"

This may sound like a stupid question, but what the heck does "MiB"
stand for in the "Create new Android Virtual Device" dialog in
Eclipse?  It -seems- like it means "megabyte", but in my 29 years of
programming, not once have I ever seen "MiB" as an acronym for
megabyte.  It's aways been MB and sometimes "Meg" and sometimes
incorrectly as "Mb" or "mb", but never "MiB".  That's why I'm asking,
and since I'm a newb to Android (not newb to programming) I'm thinking
maybe this is something Android specific and means something else
entirely.

Thanks.

-- 

3. onCreate() vs class variable initializers

4. How to get this information (In this picture) to TextView on Android ?

5. Magnetic Sensor

6. [WTA] : Disable Themes ADW

7. JUnit test case blocking main UI thread for AsyncTask