- Root Gradle uses version catalogs in
gradle/libs.versions.toml; shared rules live inbuild.gradle. app/is the entry module (com.example.assistant), wiring together feature modules with Compose and ViewBinding. Code sits inapp/src/main/java, resources inapp/src/main/res.- Feature libraries:
biometric_auth/,speech_recognition/,image_analysis/,push_notification/,battery_monitor/. Each mirrors the usualsrc/main/java|reslayout and exposes UI/logic consumed byapp. - Tests follow module boundaries: JVM tests under
src/test/java, instrumented tests undersrc/androidTest/java.
- Use the wrapper from the repo root:
./gradlew clean assembleDebugbuilds all modules and produces a debug APK. - Install and launch on a connected device/emulator:
./gradlew :app:installDebug(ensure an emulator or device is running). - JVM unit tests:
./gradlew test. Instrumented tests:./gradlew connectedAndroidTest(requires a device/emulator). - Lint and static checks:
./gradlew lintor module-scoped./gradlew :speech_recognition:lint. - Module-only builds are allowed, e.g.,
./gradlew :image_analysis:assembleDebugfor faster iteration.
- Kotlin-first codebase targeting Java 17; prefer idiomatic Kotlin (immutability, data classes, extension functions). Indent with 4 spaces.
- Compose screens live alongside traditional Views; name Composables in
PascalCasewith clear intent (BatteryDashboard()). ViewModels and controllers end with*ViewModel/*Controller. - Resource names use lowercase snake_case (
ic_microphone.xml,activity_main.xml). Keep package paths feature-scoped (...feature.speech). - Dependency versions come from the catalog; add new libraries through
gradle/libs.versions.tomland reference vialibs.*.
- Default stacks: JUnit4 for JVM tests, AndroidX JUnit + Espresso for instrumented UI tests. Compose UI tests should live in
androidTestand mirror package names. - Name tests with intent (
SpeechRecognizerTest,BatteryStatusRepositoryTest); prefer given/when/then structure inside. - Run
./gradlew testbefore pushing; run./gradlew connectedAndroidTestwhen changes touch UI, permissions, or device services.
- Follow the existing history with concise, prefixed subjects (
feat: ...,fix: ...,chore: ...,init:). Use present tense and describe scope (module and feature touched). - PRs should state what changed, why, and how to verify. Link issues/tasks, list affected modules, and attach screenshots or recordings for UI-facing updates.
- Include the commands you ran (
./gradlew test,./gradlew connectedAndroidTest, lint) so reviewers can reproduce quickly.
- Do not commit secrets or device-specific configs. Keep SDK paths in
local.properties; store API keys ingradle.propertiesor runtime config, not in source. - If adding new services (e.g., push providers, OCR), gate credentials via build configs and document required entries without checking in private files.