How adityaornet/callrecorder works
Project type and purpose
• This is a native Android application (written in Kotlin) whose single responsibility is to record incoming and outgoing phone calls on Android 9+ devices.
• It uses an AccessibilityService for call-state events, a ForegroundService+MediaRecorder for audio capture, and saves resulting .m4a files into the Music directory via MediaStore or direct file I/O.
File structure
• Top level: Gradle wrapper/config, project-wide docs (README, LICENSE, etc.), one Android Studio module named app.
• app/src/main/java/com/brainpulse/callrecorder:
• MainActivity.kt and ShareReceiverActivity.kt (UI entry points)
• Service implementations (AccessibilityService subclass, ForegroundService)
• PhoneStateListener or TelephonyManager integration
• Utility classes to manage MediaRecorder, WakeLock, file naming
• app/src/main/res: layouts for activities, XML configs (accessibility service, backup, data-extraction, file_paths).
• Test folders for unit and instrumented tests.
• Gradle scripts define Android SDK versions, dependencies, ProGuard rules, scoped storage handling.
Insights from the README
• Architecture is centered on:
• A background service that listens to phone state changes
• A MediaRecorder pipeline invoked on CALL_STATE_OFFHOOK → RECORD_AUDIO → STORE FILE → on CALL_STATE_IDLE → STOP & VALIDATE
• Permissions required: RECORD_AUDIO, FOREGROUND_SERVICE, WAKE_LOCK, READ_PHONE_STATE, READ_CALL_LOG, WRITE_EXTERNAL_STORAGE (legacy).