Creating a custom notification for wearables
In this section, we will take a look at how we can create a custom notification message that will be entered by the user within our code example. This will be done on the paired smartwatch, with the notification being displayed on the Android wearable device.
So let's get started:
- First, open the
activity_main.xml
file, which is located in theres
|layout
folder structure within Project Navigator, and add the highlighted entries as shown in the following code snippet:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android...