在没有用户输入的情况下初始化特定的复杂功能 - android wear api

Initialise specific complication without user input - android wear api

我希望能够从复杂功能中读取数据,例如天气或步数,而不必为用户创建复杂功能以select在表盘上显示哪个复杂功能。

是否可以在没有用户输入的情况下初始化特定的复杂功能,例如天气或步数?

干杯!

是的,这是可能的,但您仅限于系统提供商,或者您的自定义 并发症提供者。

默认自定义提供商:

https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine#setDefaultComplicationProvider(int,%20android.content.ComponentName,%20int)

https://developer.android.com/training/wearables/data-providers/exposing-data-complications#provider-specified-safe-watch-faces

默认系统提供商:

https://developer.android.com/reference/android/support/wearable/watchface/WatchFaceService.Engine#setDefaultSystemComplicationProvider(int,%20int,%20int)

https://developer.android.com/reference/android/support/wearable/complications/SystemProviders