This is second part of our tour around Android platforms. In the previous episode, we shared the most important requirements outlined by Google for Android TV apps. Now we are going to focus on Wear apps. What do you have to know before you start developing for Android Wear devices?
Just like with Android TV projects, Android Wear allows you to keep the same structure of code that you use in your mobile projects. Unlike in Android TV, you are able to create different types of wearable applications. The type depends on the capabilities of your watch application.This mean that your watch app can be dependent on your phone app or completely standalone. See the Standalone or dependent apps section.
Let’s take a look at the prerequisites which you should know before you start working on a project.
Since Google Announced Wear 2.0, we have two options of distributing our wear applications. The standard of distribution for Wear 1.0 apps was embedding a watch app inside a mobile app. When a user installed an application on their phone, and a compatible Wear application existed in the Play Store, the Wear version would be automatically installed on their Wear 1.0 device.
In terms of distribution on Wear 2.0 you must provide two apk files: one for mobile and one for Wear devices. To do this you must use the Multi-APK delivery method. In this case the user only gets a notification about an application being available on their watch device after they have installed it on their mobile device.
Caution: When you build a Wear 2.0 app that works with a mobile app, remember to use the same key to sign both applications.
You have to consider which devices you want to support. All devices running on Wear 2.0 use the API level 25 (Android 7.1.1). If you want support both Wear versions, the minimum and target API level must be 23 (Android 6.0).
If you are using existing code, remember to update your gradle build and add metadata that indicate whether your app is standalone or not. In the Android Manifest file ensure that the uses-feature tag is defined (android:name="android.hardware.type.watch"). Otherwise the app won’t be available for Wear devices.
We mentioned before that there are two types of wearable applications. They indicate whether your watch app is a standalone app, which means that your app doesn't require a phone-side Android app to operate. Users can use standalone Wear apps without a phone.
Caution: If you create dependent apps, the code can be shared between the Wear app and the phone app. We recommend to separate the code into different modules for the wear and phone apps. Common code can be stored in a shared library (module).
A Wear app can be:
If a watch app is completely independent or semi-independent, you must change the value of the metadata element com.google.android.wearable.standalone to true.
Caution: Even if your wearable app depends on a phone app, the watch app can be installed before the phone app. However, if the watch app detects the lacks of the necessary phone app it should prompt the user to install the phone app.
We have collected the most relevant usability requirements and tips below. Follow them and you will easily create a transparent and usable application.
See the last part about Android Auto for conclusions and a comparison of all three Android platforms.