Prerequisites
Before setting up the Wear OS app, ensure you have the following installed:- Android Studio - Latest stable version (Ladybug or newer recommended)
- Java Development Kit (JDK) - Version 11 or higher
- A Wear OS device or emulator running Wear OS 3.0+ (API level 30+)
Setup instructions
Open in Android Studio
Launch Android Studio and open the
wearos directory as a project.Android Studio will automatically:- Sync Gradle dependencies
- Download required Android SDK components
- Set up the build configuration
Configure the Wear OS emulator
If you don’t have a physical Wear OS device:
- Open Tools > Device Manager in Android Studio
- Click Create Device
- Select Wear OS category
- Choose a device definition (e.g., “Wear OS Small Round” or “Wear OS Large Round”)
- Select a system image with API level 30 or higher
- Click Finish to create the emulator
For the best development experience, use the “Wear OS Large Round” device profile with the latest system image.
Project structure
The Wear OS app uses Gradle with Kotlin DSL for build configuration:build.gradle.kts- Root project configurationapp/build.gradle.kts- App module configurationgradle/libs.versions.toml- Centralized dependency version managementsettings.gradle.kts- Project settings
Dependencies
The app uses version catalogs for dependency management. Key dependencies are defined ingradle/libs.versions.toml:
Core dependencies
- Android Gradle Plugin: 8.10.1
- Kotlin: 2.0.21
- Compose BOM: 2024.09.00
Jetpack libraries
- Wear Compose Material: 1.2.1
- Wear Compose Foundation: 1.2.1
- Activity Compose: 1.8.0
- Lifecycle ViewModel Compose: 2.9.4
- Navigation Compose for Wear: 1.5.5
- Room Runtime: 2.8.4
- Core Splashscreen: 1.0.1
Wear OS specific
- Play Services Wearable: 19.0.0
- Tiles: 1.4.0
- Tiles Material: 1.4.0
- Horologist Compose Tools: 0.6.17
- Horologist Tiles: 0.6.17
- Watchface Complications: 1.2.1
Image loading
- Coil Compose: 3.1.0
- Coil Network OkHttp: 3.1.0
Coroutines
- Kotlinx Coroutines Android: 1.10.2
- Kotlinx Coroutines Play Services: 1.10.2
Build configuration
The app is configured with the following build settings:- Application ID:
fyi.procrastinator.aero - Minimum SDK: 30 (Wear OS 3.0)
- Target SDK: 35
- Compile SDK: 36
- Version Code: 1
- Version Name: 1.0
Compilation options
Development tools
KSP (Kotlin Symbol Processing)
The project uses KSP version 2.0.21-1.0.27 for annotation processing, specifically for Room database code generation. KSP is configured in the rootbuild.gradle.kts and applied in the app module for Room compiler.
Compose preview
The app includes Compose preview support for both screens and tiles:- Use
@Previewannotations to preview composables in Android Studio - Tile previews use
@Previewwith device configurations for different watch sizes - Preview configurations available for small round and large round devices
Testing on physical device
Enable developer options
On your Wear OS watch:
- Go to Settings > System > About
- Tap Build number 7 times
- Developer options will be enabled
Enable ADB debugging
- Go to Settings > Developer options
- Enable ADB debugging
- Enable Debug over Wi-Fi (optional, for wireless debugging)
Connect via ADB
Connect your watch to your computer:Via USB (using companion phone):Via Wi-Fi:
Find your watch’s IP address in Settings > Developer options > Wi-Fi debugging.
Connecting to the mobile app
The Wear OS app receives flight data from the main Aero mobile app via the Wearable Data Layer API.You’ll need to have the main Aero Flutter mobile app installed on a paired phone for full functionality. The Wear OS app can run standalone but won’t receive flight updates without the companion app.
Message paths
The app listens for messages on these paths:/boot- Launches the app when triggered by the phone/register-flight- Receives new flight tracking data
Data format
Flight data is sent as JSON with the following structure:Troubleshooting
Gradle sync fails
If Gradle sync fails:- Check that you have JDK 11 or higher installed
- Ensure Android SDK is properly configured
- Try File > Invalidate Caches / Restart
- Delete
.gradleand.ideadirectories and re-sync
App crashes on launch
Common issues:- Ensure your device/emulator is running API level 30 or higher
- Check logcat for specific error messages
- Verify all dependencies downloaded correctly
Images not loading
Airline logo images require internet access:- Ensure the emulator/device has network connectivity
- Check that
INTERNETpermission is granted - Images fall back to FlightAware URLs if the primary image fails
Data not syncing from phone
If flight data doesn’t appear:- Ensure the phone and watch are paired properly
- Check that both apps are installed and running
- Verify Google Play Services is up to date on both devices
- Check logcat for message listener errors
Next steps
Once you have the app running:- Explore the home screen composables in
app/src/main/java/fyi/procrastinator/aero/presentation/screens/home/ - Check the database schema in
app/src/main/java/fyi/procrastinator/aero/database/entity/ - Customize the tile in
app/src/main/java/fyi/procrastinator/aero/tile/MainTileService.kt - Modify the complication in
app/src/main/java/fyi/procrastinator/aero/complication/MainComplicationService.kt