Imported from zRencore/MusicPlayer (
AGENTS.md). Install upstream withnpx skills add zRencore/MusicPlayer. Copyright stays with the author.
AGENTS.md
Scope
- This repo is a single Android app module:
:app. - Primary entrypoints are
app/src/main/java/com/example/MainActivity.kt,app/src/main/java/com/example/ui/MusicViewModel.kt,app/src/main/java/com/example/data/MusicRepository.kt, andapp/src/main/java/com/example/service/MusicService.kt.
Build And Test
- Use the Gradle wrapper from repo root:
./gradlew :app:assembleDebug,./gradlew :app:testDebugUnitTest,./gradlew :app:connectedDebugAndroidTest. :app:connectedDebugAndroidTestis the device/emulator-backed suite.- Gradle requires a local JDK; in this workspace
./gradlewcurrently fails immediately becauseJAVA_HOMEis unset. - Host-side tests include plain JUnit, Robolectric, and a Roborazzi screenshot test in
app/src/test/java/com/example/GreetingScreenshotTest.kt. - The screenshot baseline written by that test is
app/src/test/screenshots/greeting.png.
Wiring
- UI is composed directly in
MainActivity; there is no Navigation component or multi-screen structure. - Song loading comes from
MusicRepository.getLocalSongs(), which queriesMediaStore.Audio.Mediaand only returns rows whereIS_MUSIC != 0. - Playback is driven through Media3:
MusicViewModelconnects toMusicServiceviaMediaController, andMusicServiceowns theExoPlayer+MediaSession.
Repo-Specific Gotchas
namespaceiscom.example, butapplicationIdiscom.aistudio.musicplayer.fklqpzinapp/build.gradle.kts. Do not assume they match when editing manifests, tests, or package-name assertions.app/src/androidTest/java/com/example/ExampleInstrumentedTest.ktis stale as checked in: it assertscom.example, which does not match the currentapplicationId.README.mdis partly stale. Its AI Studio setup language and the instruction to removesigningConfig = signingConfigs.getByName("debugConfig")do not match the currentapp/build.gradle.kts.- The Secrets Gradle plugin is configured to read
.envand.env.example, but the checked-in app code inapp/src/maindoes not currently referenceGEMINI_API_KEY.
Generated Files
- Treat
app/build/as generated output; do not edit files there.
