Wearable_Insight_Forum

 

Notifications
Clear all

Procedure for using Android Studio and Kotlin/Java for app development in Wear OS (Google).

5 Posts
2 Users
0 Reactions
64 Views
wearablemake
(@wearablemake)
Posts: 338
Reputable Member
Topic starter
 

Wear OS app development uses essentially the same development environment as Android app development, but there are some additional settings and considerations specific to wearable devices.

1. Setting up the Development Environment:

  • Install Android Studio: Install the latest version of Android Studio. Android Studio is an integrated development environment (IDE) for Android development and is essential for Wear OS app development.
  • Install Android SDK: Install the Wear OS platform and related tools through the Android SDK Manager. In particular, to use the Wear OS emulator, you need to install the necessary SDK Platforms and System Images.
  • Set up a Wear OS Emulator (Recommended): Even without an actual Wear OS device, you can test your app using an emulator. Create and configure a Wear OS emulator through the AVD Manager. You can choose circular or rectangular displays, various hardware specifications, etc.

2. Creating a Project:

  • Create a New Project: In Android Studio, select “New Project.”
  • Select a Template: Select the desired template from the “Wear OS” tab. You can select “Empty Wear Activity” to create a basic Wear OS app project.
  • Configure the Project: Set the project name, package name, minimum SDK version, etc. To take advantage of the latest features of Wear OS, you need to select an appropriate SDK version.

3. Adding Dependencies:

  • Add Wear OS-related dependencies to the build.gradle file. In particular, the Wear OS UI library (androidx.wear.compose) is essential for Wear OS app development.
Gradle

 
dependencies {
    implementation "androidx.wear.compose:compose-material:$wear_compose_version"
    implementation "androidx.compose.ui:ui:$compose_version"
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
    debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
    debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
    implementation "androidx.wear:wear:$wear_version"
    implementation 'com.google.android.gms:play-services-wearable:18.0.0' // Add as needed
}

4. Designing the UI:

  • Use Compose UI (Recommended): It is recommended to use Jetpack Compose for Wear OS app UI development. Compose is a declarative UI framework that enables concise and efficient UI development.
  • Adhere to Wear OS Design Guidelines: Wear OS has unique characteristics such as circular displays and small screen sizes, so you should design the UI in accordance with the Wear OS design guidelines. In particular, it is important to utilize components optimized for circular screens.
    • The androidx.wear.compose library provides components specialized for Wear OS (e.g., CircularProgressIndicator, ScalingLazyColumn).
Kotlin

 
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.wear.compose.material.*

@Composable
fun WearApp(greetingName: String) {
    /* If you have enough items available, use a ScalingLazyColumn
     * to support scaling layouts for different round devices.
     */
    ScalingLazyColumn(
        modifier = Modifier.fillMaxSize(),
        verticalArrangement = Arrangement.Center,
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        item {
            Text(
                text = "Hello $greetingName!",
                modifier = Modifier
                    .padding(bottom = 8.dp)
            )
        }
    }
}

@Preview(device = Devices.WEAR_OS_LARGE_ROUND)
@Composable
fun DefaultPreview() {
    WearApp("Android")
}

5. Implementing Functionality:

  • Utilize Android APIs: Because Wear OS is based on Android, you can utilize most Android APIs.
  • Utilize Wear OS-Specific APIs: Wear OS provides APIs specialized for wearable devices. For example, you can use the Sensor APIs to obtain data such as heart rate and acceleration, and you can use the Complications API to display information on the watch face.

6. Testing and Debugging:

  • Test on an Emulator or a Real Device: Test the app on an emulator or a real Wear OS device. Emulators are useful for testing various screen sizes and hardware specifications, while real devices allow you to check performance and user experience in a real-world usage environment.
  • Utilize Android Debug Bridge (ADB): You can use ADB to install apps on emulators or real devices, check logs, and perform debugging tasks.

7. Packaging and Distribution:

  • Distribute on the Play Store: Wear OS apps can be distributed through the Google Play Store. You can distribute them together with smartphone apps or as standalone Wear OS apps.

By following the above steps, you can develop Wear OS apps. If you have Android development experience, you can start relatively easily, and it is important to be familiar with the Wear OS-specific UI/UX design guidelines.


 
Posted : 20/01/2025 3:09 am
gunther
(@gunther)
Posts: 35
Eminent Member
 

What development environment do I need to prepare to start developing Wear OS apps?


 
Posted : 27/08/2025 12:59 pm
wearablemake
(@wearablemake)
Posts: 338
Reputable Member
Topic starter
 

First, you need to install the latest version of Android Studio. Then, install the Wear OS platform and related tools (specifically, SDK Platforms and System Images) through the Android SDK Manager.

Even without a physical device, you can create Wear OS emulators with various specifications, such as circular and square screens, through the AVD Manager for testing.


 
Posted : 27/08/2025 1:00 pm
gunther
(@gunther)
Posts: 35
Eminent Member
 

What special considerations should I take into account when designing a Wear OS app UI?


 
Posted : 27/08/2025 1:00 pm
wearablemake
(@wearablemake)
Posts: 338
Reputable Member
Topic starter
 

Because Wear OS often features small, circular screens, UI/UX guidelines must be followed more strictly than for regular Android apps.

By leveraging the androidx.wear.compose library, based on Jetpack Compose, you can easily use components optimized for circular screens (e.g., CircularProgressIndicator and ScalingLazyColumn).


 
Posted : 27/08/2025 1:00 pm
Share: