{"id":13609606,"url":"https://github.com/farimarwat/ANR-Spy","last_synced_at":"2025-04-12T20:32:10.263Z","repository":{"id":77714353,"uuid":"579959968","full_name":"farimarwat/ANR-Spy","owner":"farimarwat","description":"Android ANR Spy is an android ANR sdk/library for detecting  android ANR (Application Not Responding)","archived":false,"fork":false,"pushed_at":"2024-08-11T06:27:05.000Z","size":176,"stargazers_count":58,"open_issues_count":2,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-07T15:45:48.455Z","etag":null,"topics":["android","android-anr","android-app","android-studio","androidsdk","anr","anr-spy","errors","sdk"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/farimarwat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-19T11:22:57.000Z","updated_at":"2024-10-08T16:24:31.000Z","dependencies_parsed_at":"2024-01-16T23:31:05.277Z","dependency_job_id":"f768dbea-2c40-43b2-b656-5bfc8676e8d7","html_url":"https://github.com/farimarwat/ANR-Spy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farimarwat%2FANR-Spy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farimarwat%2FANR-Spy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farimarwat%2FANR-Spy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/farimarwat%2FANR-Spy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/farimarwat","download_url":"https://codeload.github.com/farimarwat/ANR-Spy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248629840,"owners_count":21136325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-anr","android-app","android-studio","androidsdk","anr","anr-spy","errors","sdk"],"created_at":"2024-08-01T19:01:36.445Z","updated_at":"2025-04-12T20:32:07.891Z","avatar_url":"https://github.com/farimarwat.png","language":"Kotlin","funding_links":["https://patreon.com/farimarwat"],"categories":["Kotlin"],"sub_categories":[],"readme":"## This library has been deprecated. Now use \u003ca href=\"https://github.com/farimarwat/grizzly\"\u003eGrizzly\u003c/a\u003e\n\n\n### Android ANR Spy\nAndroid ANR Spy is the most simplest library that helps android developers to detect ANRs. The ANRspy library helps in detecting and reporting Application Not Responding (ANR) issues in Android applications. It provides integration with Firebase Crashlytics for reporting and allows setting custom actions when an ANR is detected.\n\n### Features\n1. Detect ANR\n2. Detect a function which is approaching ANR limit and send report to firebase prior to ANR occurrence.\n3. Prevent from downranking your app on google play console by exiting app prior to anr occurance. \n\n### What is Android ANR (Application Not Responding)\nwhen a developer do most heavy jobs on UI thread (more than 5 seconds usually) and UI thread still receieve more request/events for doing a task then Android system raises ANR message. This is extremely bad effect on your app and may lead to the failure of your business.\n### Android ANR does matter\nGoogle recommends/suggests your app on play store. If your app raises too many ANRs then your app will be ranked down\n\n### Android ANR Durations\n1. Normal on UI Thread in any activity = 5 secs\n2. BroadCast = 10 sec\n3. Service = 20 sec\n\n\n\u003ch4\u003e\u003ca href=\"https://www.youtube.com/watch?v=329yhbNjaHg\"\u003eVideo Tutorial \u003c/a\u003e\u003c/h4\u003e\n\n**Note: Sample app is included in the project. Just clone the repo**\n\n## Android ANR Spy Library\n### Implement:\n\n```\nimplementation(\"io.github.farimarwat:anrspy:2.1\")\n```\n## Usage\n```\n// Initialize FirebaseCrashlytics\nval crashlyticsInstance = FirebaseCrashlytics.getInstance()\n\n// Create ANRSpyAgent\nval anrSpyAgent = ANRSpyAgent.Builder(this)\n    .setTimeOut(5000L) // Set timeout threshold (in milliseconds)\n    .setTicker(200L) // Set the interval at which the main thread is checked (in milliseconds)\n    .setFirebaseCrashLytics(crashlyticsInstance) // Set FirebaseCrashlytics instance\n    .setAppAction(AppAction.AppActionExit) // Set the action to perform when an ANR is detected\n    .build()\n```\n\n### Tips\n#### Firebase Integration:\nBy setting up FirebaseCrashlytics, you will receive reports in the form of fatal exceptions (not ANR/crash). This means if any function is approaching the ANR limit, a report will be sent to Firebase. This can help in identifying potential ANR issues before they cause a crash.\n\n#### Preventing ANR Reports to Google Play Console:\nBy setting an app action such as AppAction.AppActionExit, the library will prevent ANR from being reported to the Google Play Console by exiting the application before the ANR occurs.\n\n## Change Log\n**version 2.1**\n\n- throwException method removed\n- AppAction feature added\n\n\n**version 2.0**\n\n1. ANR detection with annotation method removed\n2. ANR detection algorithm changed\n3. A lot of extra functions removed\n\n**version 1.3**\n1. Get details of methods which is related to main app package that causes anrs via \"onAnrDetected\" extra paramater\n2. A bug fixed (classnotfoundexception)\n\n**version 1.2 (beta)**\n1. Annotation added to trace a specific method for ANR\n2. Store annotated methods report in firebase analytics\n\n**version 1.0**\nInitial release\n\n## Support Me\nIf you want to donate then you are welcome to buy me a cup of tea via **PATREON** because this encourages me to give you more free stuff\nand continue to  maintain this library\n\n\u003ca href=\"https://patreon.com/farimarwat\"\u003eBuy Now!\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarimarwat%2FANR-Spy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffarimarwat%2FANR-Spy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffarimarwat%2FANR-Spy/lists"}