Contributing

Thanks for your interest in contributing! WearAmp is an open-source Wear OS music player for Plex. All kinds of contributions are welcome β€” bug fixes, new features, tests, and documentation improvements.

Before you start

Please open an issue before starting work on a significant change. This lets us discuss the approach and make sure effort isn’t duplicated.

For small fixes (typos, minor bugs) feel free to open a pull request directly.


Getting started

Prerequisites

Clone and build

git clone https://github.com/03c/WearAmp.git
cd WearAmp
./gradlew :app:assembleDebug

Open the project in Android Studio and run it on a Wear OS device or emulator.

Running the tests

# Unit tests
./gradlew :app:testDebugUnitTest

# Lint
./gradlew :app:lintDebug

Project structure

app/src/main/java/com/wearamp/
β”œβ”€β”€ WearAmpApplication.kt          Application class (Hilt entry point)
β”œβ”€β”€ MainActivity.kt                Wear OS main activity
β”œβ”€β”€ di/
β”‚   β”œβ”€β”€ NetworkModule.kt           Hilt network dependency providers
β”‚   └── PlexServerUrlInterceptor.kt  OkHttp interceptor that rewrites
β”‚                                    media API requests with the user's
β”‚                                    configured server URL
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ PlexAuthApi.kt         Plex authentication REST API
β”‚   β”‚   β”œβ”€β”€ PlexMediaApi.kt        Plex media/library REST API
β”‚   β”‚   └── model/                 Gson data models (PlexPin, PlexMedia…)
β”‚   β”œβ”€β”€ local/
β”‚   β”‚   └── UserPreferences.kt     DataStore β€” auth token, server URL,
β”‚   β”‚                              client ID, username
β”‚   └── repository/
β”‚       β”œβ”€β”€ AuthRepository.kt      PIN creation, polling & logout
β”‚       └── MediaRepository.kt     Library browsing & track rating
β”œβ”€β”€ domain/
β”‚   └── model/                     Domain models (Track, Album, Artist…)
β”œβ”€β”€ service/
β”‚   └── WearAmpMediaService.kt     Media3 background playback service
└── presentation/
    β”œβ”€β”€ navigation/                 Wear swipe-dismiss nav graph
    β”œβ”€β”€ theme/                      Compose theme (Plex orange palette)
    └── screens/
        β”œβ”€β”€ login/                  PIN login flow
        β”œβ”€β”€ library/                Music library section list
        β”œβ”€β”€ browse/                 Artists β†’ Albums β†’ Tracks browser
        β”œβ”€β”€ player/                 Now Playing controls
        └── settings/               Server URL & sign-out

Key architectural decisions

Concern Approach
UI Jetpack Compose for Wear OS
Navigation SwipeDismissableNavHost (Wear gesture support)
DI Hilt (ViewModels via @HiltViewModel)
State StateFlow + collectAsState()
Media playback Media3 / ExoPlayer + Horologist
Networking Retrofit + OkHttp; server URL injected via interceptor
Auth Plex PIN-based OAuth (plex.tv)
Persistence DataStore Preferences

Pull request guidelines

  1. Branch from main and name your branch descriptively (e.g. feat/track-playback or fix/auth-timeout).
  2. Keep pull requests focused β€” one feature or fix per PR.
  3. Update documentation if your change affects user-facing behaviour or the project structure.
  4. Run the tests and lint before submitting:
    ./gradlew :app:testDebugUnitTest :app:lintDebug
    
  5. Fill in the PR description β€” explain what changed and why.

The CI workflow will automatically build and lint your PR. A reviewer will take a look as soon as possible.


Code style


License

By contributing you agree that your code will be released under the same license as the rest of the project.