语言

Menu
Sites
Language
How to find out what watchface complication providers are available

I've been reading the docs about watchface complications and while it makes sense for someone who is building both a watchface app *and* a complication provider, it's missing information needed for someone who is only building a watchface app and wants to add a complication for a provider that already exists.  What should I supply for the provider ID?  How can I discover what provider IDs are already registered?  The Android Wear docs talk about complications as well and these docs provide a list of system providers, but all of these IDs are ints and the Tizen API uses a string for the provider ID.  Is there any more information or sample code available for this?

响应

2 回复
Hyunho Kang

Sorry for your inconvenience. First, we do not provide system providers. As for the provider id, Tizen also uses string values. The ID used as an Integer value is a complication ID used by watchface applications to manage complications locally, and its purpose is different from the provider ID. 

Basically, the complication API specifies the type and default provider that the complication can display and selects complication in the editor.
The default provider can be specified as a parameter in the watchface_complication_create function, and the provider id used here is the value declared as String in the manifest file of the complication provider app, such as <complication provider-id="org.tizen.complication-provider/battery">.

And unfortunately, no official online samples are provided. However, you can check the implementation of the complication applied watchface application, which is one of the default Tizen public binary watchface applications in the below link.
https://review.tizen.org/gerrit/#/admin/projects/profile/wearable/apps/native/analog-watch

David Jackman

Thanks.  This isn't very helpful.  I'm not talking about complication IDs at all.  I'm only talking about provider IDs.  In the Android Wear SDK (documented here) the provider ID is an integer.  Is there any correlation between the complications for Android Wear and the complications for Tizen?

And as I said before, I'm not writing a complication provider app.  I want to show complication data from other providers.  How do I get the manifest information from the apps already installed so I can get their provider ID to use as the default provider in watchface_complication_create?