[HTML payload içeriği buraya]
33.4 C
Jakarta
Thursday, May 7, 2026

Bringing Androidify to Put on OS with Watch Face Push



Posted by Garan Jenkin – Developer Relations Engineer



Just a few months in the past we
relaunched Androidify as an app for producing personalised Android bots. Androidify transforms your selfie picture right into a playful Android bot utilizing Gemini and Imagen.

Nevertheless, provided that Android spans a number of kind elements, together with our most up-to-date addition, XR, we thought, how might we deliver the enjoyable of Androidify to Put on OS?

An Androidify watch face

As Androidify bots are highly-personalized, the pure place to showcase them is the watch face. Not solely is it essentially the most ceaselessly seen floor but additionally essentially the most private floor, permitting you to signify who you’re.


Personalised Androidify watch face, generated from selfie picture

Androidify now has the power to generate a watch face dynamically throughout the cellphone app after which ship it to your watch, the place it’ll routinely be set as your watch face. All of this occurs inside seconds!

Excessive-level design

Finish-to-end circulate for watch face creation and set up

With the intention to obtain the end-to-end expertise, quite a lot of applied sciences have to be mixed collectively, as proven on this high-level design diagram.

Initially, the person’s avatar is mixed with a pre-existing Watch Face Format template, which is then packaged into an APK. That is validated – for causes which shall be defined! – and despatched to the watch.

On being acquired by the watch, the brand new Watch Face Push API – a part of Put on OS 6- is used to put in and activate the watch face.

Let’s discover the small print:

Creating the watch face templates

The watch face is created from a template, itself designed in Watch Face Designer. That is our new Figma plugin that permits you to create Watch Face Format watch faces immediately inside Figma.


An Androidify watch face template in Watch Face Designer

The plugin permits the watch face to be exported in a vary of various methods, together with as Watch Face Format (WFF) assets. These can then be simply integrated as property throughout the Androidify app, for dynamically constructing the finalized watch face.

Packaging and validation

As soon as the template and avatar have been mixed, the Moveable Asset Compiler Package (Pack) is used to assemble an APK.

In Androidify, Pack is used as a native library on the cellphone. For extra particulars on how Androidify interfaces with the Pack library, see the GitHub repository.

As a last step earlier than transmission, the APK is checked by the Watch Face Push validator.

This validator checks that the APK is appropriate for set up. This consists of checking the contents of the APK to make sure it’s a legitimate watch face, in addition to some efficiency checks. Whether it is legitimate, then the validator produces a token.

This token is required by the look ahead to set up.

Sending the watch face

The Androidify app on Put on OS makes use of WearableListenerService to pay attention for occasions on the Wearable Information Layer.

The cellphone app transfers the watch face through the use of a mix of MessageClient to arrange the method, then ChannelClient to stream the APK.

Putting in the watch face on the watch

As soon as the watch face is acquired on the Put on OS system, the Androidify app makes use of the brand new Watch Face Push API to put in the watch face:

val wfpManager = 

    WatchFacePushManagerFactory.createWatchFacePushManager(context)

val response = wfpManager.listWatchFaces()

attempt {

    if (response.remainingSlotCount > 0) {

        wfpManager.addWatchFace(apkFd, token)

    } else {

        val slotId = response.installedWatchFaceDetails.first().slotId

        wfpManager.updateWatchFace(slotId, apkFd, token)

    }

} catch (a: WatchFacePushManager.AddWatchFaceException) {

    return WatchFaceInstallError.WATCH_FACE_INSTALL_ERROR

} catch (u: WatchFacePushManager.UpdateWatchFaceException) {

    return WatchFaceInstallError.WATCH_FACE_INSTALL_ERROR

}

Androidify makes use of both the addWatchFace or updateWatchFace technique, relying on the situation: Watch Face Push defines an idea of “slots” – what number of watch faces a given app can have put in at any time. For Put on OS 6, this worth is actually 1.

Androidify’s strategy is to put in the watch face if there’s a free slot, and if not, any current watch face is swapped out for the brand new one.

Setting the energetic watch face

Putting in the watch face programmatically is a good step, however Androidify seeks to make sure the watch face can be the energetic watch face. 

Watch Face Push introduces a brand new runtime permission which should be granted to ensure that apps to have the ability to obtain this:

com.google.put on.permission.SET_PUSHED_WATCH_FACE_AS_ACTIVE

As soon as this permission has been acquired, the wfpManager.setWatchFaceAsActive() technique could be known as, to set an put in watch face to being the energetic watch face.

Nevertheless, there are a variety of issues that Androidify has to navigate:

  • setWatchFaceAsActive can solely be used as soon as.

  • SET_PUSHED_WATCH_FACE_AS_ACTIVE can’t be re-requested after being denied by the person.

  • Androidify may already be answerable for the energetic watch face.

For extra particulars see how Androidify implements the set energetic logic.

Get began with Watch Face Push for Put on OS

Watch Face Push is a flexible API, equally suited to enhancing Androidify as it’s to constructing fully-featured watch face marketplaces.

Maybe you may have an current cellphone app and are searching for alternatives to additional have interaction and delight your customers?

Or maybe you’re an current watch face developer seeking to create your individual neighborhood and gallery by means of releasing a market app?

Check out these assets:

And in addition try the accompanying video for a greater-depth take a look at how we introduced Androidify to Put on OS!

We’re wanting ahead to what you’ll create with Watch Face Push!

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles