ANR-WatchDog | simple watchdog that detects Android ANR | Architecture library
kandi X-RAY | ANR-WatchDog Summary
kandi X-RAY | ANR-WatchDog Summary
A simple watchdog that detects Android ANR (Application Not Responding) error and throws a meaningful exception
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Runs the ANR watchdog thread
- Creates a new ANRror
- Creates a new main thread
- Get thread title
- Fills in stack trace
ANR-WatchDog Key Features
ANR-WatchDog Examples and Code Snippets
Community Discussions
Trending Discussions on ANR-WatchDog
QUESTION
On an Android 4.3 embedded (custom) device, I am trying to debug my app by setting a breakpoint in a Service sub-class onStartCommand method. When I am paused at the breakpoint dalvik kills my app due to ANR not realizing that I am debugging.
The logcat shows:
...ANSWER
Answered 2019-Mar-08 at 20:58In developer settings, there is an option called "select debug app". Click on this and select the application you will be debugging. This should prevent any ANRs from occurring for that app, while you are debugging it. It also enables the "wait for debugger" option, which, if enabled, will pause the app as soon as it starts, so you can attach a debugger and debug the applications startup code, if necessary.
QUESTION
I have implemented a ANR watchdog in my application using this GitHub repo. The watchdog monitors the UI thread and if it is blocked for more than 10 seconds, if restarts the app. My problem is it restarts the app twice, thus messing with all my logic.
This is my implementation of the WatchDog :
...ANSWER
Answered 2018-Oct-18 at 09:55So I was finally able to solve this.
System.exit() was not enough in my case. I had to call finish() or finishAffinity() on the activity which was causing the ANR.
So in the
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ANR-WatchDog
You can use ANR-WatchDog like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the ANR-WatchDog component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page