android-bug-hunting-main-thread-violations

Detect main-thread I/O, network, and heavy operations in Android codebases.

Updated Jan 2, 2024
One-click install
npx skills add https://github.com/Mithrandir21/game-deals-android-app --skill android-bug-hunting-main-thread-violations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: android-bug-hunting-main-thread-violations
Source: https://github.com/Mithrandir21/game-deals-android-app/tree/main/.claude/skills/android-bug-hunting-main-thread-violations
Command: npx skills add https://github.com/Mithrandir21/game-deals-android-app --skill android-bug-hunting-main-thread-violations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps developers detect and mitigate main-thread operations that cause app jank, slow startup, and ANRs.

Core Features & Use Cases

  • Detection of blocking I/O and heavy work: Finds code patterns like network, disk, and JSON operations on the main thread.
  • Scope coverage: Analyzes Kotlin and Java files for synchronous calls such as database, network, or file access during startup or UI interactions.
  • Use Case: When debugging startup delays or frame drops, use this skill to identify code that runs synchronously on the main thread, then refactor to perform such operations asynchronously.

Quick Start

Use this skill to scan your project files for main-thread violations and generate a report detailing their locations and severity.

Frequently Asked Questions about android-bug-hunting-main-thread-violations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find main thread violations causing Android ANR and UI jank?

To find main thread violations causing Android ANR and UI jank, scan your codebase for synchronous network calls, disk I/O, and JSON parsing operations. This identifies blocking tasks on the UI thread that cause app non-responsiveness and frame drops.

What causes an Android ANR during app startup?

Android ANR during app startup is caused by executing heavy operations like database access, network calls, or JSON parsing synchronously on the main thread. Analyzing your Kotlin and Java files detects these blocking startup tasks.

How do I detect blocking I/O operations on the Android UI thread?

To detect blocking I/O operations on the Android UI thread, analyze your project files for synchronous disk and network access patterns. This process verifies code practices against asynchronous standards and reports violation locations and severity.

Does this main thread violation scanner work with Kotlin and Java files?

Yes, this main thread violation scanner analyzes both Kotlin and Java files. It checks these codebases for synchronous calls during UI interactions and startup, ensuring all detected heavy operations are refactored for asynchronous execution.

What is the best way to prevent UI jank from heavy operations in Android?

The best way to prevent UI jank from heavy operations in Android is to identify synchronous database, network, and file access on the main thread, then refactor them to perform asynchronously. This ensures efficient, responsive apps.

Why does my Android app drop frames during JSON parsing and database access?

Your Android app drops frames during JSON parsing and database access because these heavy operations run synchronously on the main thread. Scanning the codebase identifies these specific blocking patterns so they can be moved to background threads.