{"id":114,"date":"2025-07-19T02:12:32","date_gmt":"2025-07-19T07:12:32","guid":{"rendered":"https:\/\/blog.alangaelrojas.com\/?p=114"},"modified":"2025-07-30T19:43:28","modified_gmt":"2025-07-31T00:43:28","slug":"introduction-to-wear-os","status":"publish","type":"post","link":"https:\/\/blog.alangaelrojas.com\/index.php\/2025\/07\/19\/introduction-to-wear-os\/","title":{"rendered":"Introduction to Wear OS"},"content":{"rendered":"\n<p>An overview of Wear OS (formerly Android Wear) development and how to take advantage as an Android Developer.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1020\" height=\"388\" src=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/image.png\" alt=\"\" class=\"wp-image-115\" srcset=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/image.png 1020w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/image-300x114.png 300w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/image-768x292.png 768w\" sizes=\"auto, (max-width: 1020px) 100vw, 1020px\" \/><\/figure>\n\n\n\n<p>I would like to share my knowledge developing for wearables (smartwatches), coming from Android development with Kotlin and Jetpack Compose.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><br>What is it?<\/h2>\n\n\n\n<p>Wear OS is Google&#8217;s smartwatch platform, enabling Android devs to build apps for wearable devices. With the rising popularity of fitness and productivity-focused watches, knowing how to build for Wear OS is a valuable skill. In this guide, we\u2019ll go from the basics to publishing your first production-ready Wear OS app.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Setting up the environment<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Install Android Studio (latest stable).<\/li>\n\n\n\n<li>SDK requirements (API 30+ recommended).<\/li>\n\n\n\n<li>Emulator setup (Pixel Watch 2 or similar).<\/li>\n\n\n\n<li>Use <strong>Android Studio&#8217;s Device Manager<\/strong> to create a Wear OS virtual device.<\/li>\n<\/ul>\n\n\n\n<p>Optionally: real device (connect via Bluetooth or Wi-Fi debugging).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Project structure<\/h2>\n\n\n\n<p>There are two common approaches:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Standalone app (only for Wear)<\/li>\n\n\n\n<li>Companion + Wear app (phone app with a module for Wear)<\/li>\n<\/ol>\n\n\n\n<p>In the first case, <strong>standalone<\/strong>, we tell the system that our Wear app works independently, meaning it doesn\u2019t require a phone app to function. Many Wear apps manage their state without even needing the phone to be connected. However, unless the app handles some kind of caching on the watch, many of them won\u2019t work properly without relying on the phone\u2019s internet connection. Connectivity plays a very important role, as we\u2019ll see next.<\/p>\n\n\n\n<p>The watch can connect to the outside world in several ways:<\/p>\n\n\n\n<p><strong>Network proxy via phone Bluetooth<\/strong><br>In this mode, the watch accesses the internet natively by using the active Bluetooth connection maintained while it\u2019s paired with the phone.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"788\" src=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-proxy.png\" alt=\"\" class=\"wp-image-117\" srcset=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-proxy.png 940w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-proxy-300x251.png 300w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-proxy-768x644.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p><strong>Built-in network connection<\/strong><br>On the other hand, higher-end watches go beyond just using the phone&#8217;s internet connection. They can also connect to any Wi-Fi network configured on the phone or even manually connect to a different one. Additionally, some models support LTE or cellular networks via a built-in SIM or eSIM, giving them the ability to operate completely independently from Wi-Fi. This means they can make calls and receive messages without needing the phone nearby.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"940\" height=\"788\" src=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-local.png\" alt=\"\" class=\"wp-image-118\" srcset=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-local.png 940w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-local-300x251.png 300w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/android-network-local-768x644.png 768w\" sizes=\"auto, (max-width: 940px) 100vw, 940px\" \/><\/figure>\n\n\n\n<p>With that in mind, developing a Wear app in <strong>standalone mode<\/strong> allows our app to function with or without the phone, depending on the device\u2019s capabilities. This is extremely useful when the business logic is entirely watch-based \u2014 for example, a fitness tracker, step counter, calorie tracker, etc.<\/p>\n\n\n\n<p>On the other hand, if our app depends on the companion app being installed on the phone or requires a background service running there, we need to configure the Wear app with <code>standalone = false<\/code>, like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"406\" src=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/carbon-standalone-manifest-1-1024x406.png\" alt=\"\" class=\"wp-image-120\" srcset=\"https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/carbon-standalone-manifest-1-1024x406.png 1024w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/carbon-standalone-manifest-1-300x119.png 300w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/carbon-standalone-manifest-1-768x304.png 768w, https:\/\/blog.alangaelrojas.com\/wp-content\/uploads\/2025\/07\/carbon-standalone-manifest-1.png 1332w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The standalone flag doesn\u2019t restrict the app from working with or without the phone; it simply informs the system \u2014 for example, for Google Play \u2014 that the app may require the phone to function properly.<\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Developing apps<\/h2>\n\n\n\n<p>If you\u2019re already familiar with native Android development, building for Wear OS will feel very natural. We have access to nearly the same design elements and development tools as in the native Android ecosystem, such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Activities<\/li>\n\n\n\n<li>Fragments (deprecated)<\/li>\n\n\n\n<li>ViewModels (allowing MVVM)<\/li>\n\n\n\n<li>Common libraries such as Dagger Hilt, Room, Retrofit <\/li>\n\n\n\n<li>Services (Service, TileService,  WorkManager)<\/li>\n\n\n\n<li>Jetpack Compose + XML UI-based<\/li>\n\n\n\n<li>Intent, BroadCast receiver (with limitations)<\/li>\n\n\n\n<li>etc<\/li>\n<\/ul>\n\n\n\n<p>So, you won\u2019t face major issues developing Wear apps \u2014 the only thing you really need to focus on is creating an app that people enjoy and making sure it follows Google\u2019s design <a href=\"https:\/\/developer.android.com\/training\/wearables\/user-interfaces\" title=\"\">guidelines <\/a>for Wear OS.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">References\/Links<\/h2>\n\n\n\n<p><a href=\"https:\/\/developer.android.com\/courses\/pathways\">https:\/\/developer.android.com\/courses\/pathways<\/a><br><a href=\"https:\/\/developer.android.com\/training\/wearables\/user-interfaces\">https:\/\/developer.android.com\/training\/wearables\/user-interfaces<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\ud83d\udcac <strong>Your thoughts?<\/strong><br>Building a Wear OS app too? Share your experience or questions in the comments \u2014 let\u2019s connect! \ud83d\udc47<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>An overview of Wear OS (formerly Android Wear) development and how to take advantage as an Android Developer. I would like to share my knowledge developing for wearables (smartwatches), coming from Android development with Kotlin and Jetpack Compose. What is it? Wear OS is Google&#8217;s smartwatch platform, enabling Android devs to build apps for wearable&#8230;<\/p>\n","protected":false},"author":1,"featured_media":124,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,4,30],"tags":[27,28,29,31],"class_list":["post-114","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","category-programming","category-wear","tag-android","tag-kotlin","tag-programming","tag-wear"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":4,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"predecessor-version":[{"id":166,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/posts\/114\/revisions\/166"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/media\/124"}],"wp:attachment":[{"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.alangaelrojas.com\/index.php\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}