简体   繁体   English

如何在Android Wear中支持新的环境模式?

[英]How to support new ambient mode in android wear?

Since last update Android Wear has a new feature - the always-on mode. 自上次更新以来,Android Wear具有一项新功能-始终在线模式。 This means that the Android Wear device doesn't turn off the screen; 这意味着Android Wear设备不会关闭屏幕。 it changes to the ambient mode to save battery and keeps certain apps running in the background. 它更改为环境模式以节省电池并保持某些应用程序在后台运行。

How exactly should I implement this? 我应该如何实施呢?

ps I'm developing sport application, not watchface. ps我正在开发运动应用程序,而不是表面。

We have also created a code lab to run through the steps. 我们还创建了一个代码实验室来完成这些步骤。 Please find it here: 请在这里找到它:

https://io2015codelabs.appspot.com/codelabs/always-on#1 https://io2015codelabs.appspot.com/codelabs/always-on#1

What you're looking for is how to support "Ambient Mode" in your Wear app's activity. 您正在寻找的是如何在Wear应用程序的活动中支持“环境模式”。

There is an entire doc dedicated to this: 有一个完整的文档专用于此:

http://developer.android.com/training/wearables/apps/always-on.html http://developer.android.com/training/wearables/apps/always-on.html

As well as a code sample: 以及代码示例:

https://github.com/googlesamples/android-AlwaysOn/ https://github.com/googlesamples/android-AlwaysOn/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM