Coinciding with growing rumors that Google is about to launch its first smartwatch, Google is eyeing up developers turning their attention to Wear OS. The latest addition allows them to easily create custom maps with very few lines of code.

This is possible with Jetpack’s Glance library, which debuted in December last year as an easy way to create Material You widgets. Now Glance is making the leap to smartwatches and can be used to create Wear OS maps.

Maps with Jetpack Compose

Google has just announced that Glance is now compatible with Wear OS, a new and very simple way to generate a modern interface with a few lines of code. Glance came out a few months ago to do the same thing, but with Android widgets.

Wear OS cards haven’t been on the platform for long: they came out a few years ago, with a closed list limited to pre-installed Google apps, but the ban was opened last year for developers to create their own. own maps for their devices. .applications. Now Google has introduced an even easier way to generate these maps, although officially this is still an alpha release.

Based on Jetpack Compose, with Glance you can generate the map interface and functionality with very few lines of code, by combining basic elements such as boxes, columns, lines, images, spaces , curved lines and curved text. A “Hello World” card in Glance is as simple as this code:

HelloTileService class: GlanceTileService() {

@Composable

replace funContent() {

Text(text = “Hello Look”)

} }

It’s still an alpha release, but developers can start testing it, with demos available. For users, this should mean we’re seeing more app cards and Google will continue to promote their use. After all, Google defines it as one of “the most used surfaces of Wear OS, just a swipe from the watch face.”

More information | Android Developers