android wear开发之:创建可穿戴设备应用 - Creating Wearable Apps
注:本文内容来自:https://developer.android.com/training/wearables/apps/index.html
翻译水平有限,如有疏漏,欢迎批评指教。
译:山人
创建可穿戴设备应用
Creating Wearable Apps
Wearable apps run directly on the device, giving you access to hardware such as sensors and the GPU. They are fundamentally the same as apps built for other devices using the Android SDK, but differ greatly in design and usability and the amount of functionality provided. These are the main differences between handheld and wearable apps:
可穿戴设备应用直接运行在设备上,允许你访问诸如传感器和GPU之类的硬件。它们本质上与运行在其他设备上并且使用Android SDK的应用相同,但是在设计、可用性与功能提供的数量上有很大的不同。下面是手持设备与可穿戴设备主要的区别:
- Wearable apps are relatively small in size and functionality compared to handheld apps. They contain only what makes sense on the wearable, which is usually a small subset of the corresponding handheld app. In general, you should carry out operations on the handheld when possible and send the results to the wearable.
可穿戴设备应用拥有比手持设备应用更小的尺寸和更少的功能。他们只包含可穿戴设备的创造理念,通常是相当于手持设备应用更小的子集。一般而言,你应当尽可能在手持设备上操作,并将结果发送到可穿戴设备之上。
- Users don't download apps directly onto the wearable. Instead, you bundle the wearable app inside the handheld app. When users install the handheld app, the system automatically installs the wearable app. However, for development purposes, you can still install the wearable app directly to the wearable.
用户不直接在可穿戴设备上下载应用。作为替代,你将在手持设备应用里绑定可穿戴设备应用。当用户安装了手持设备应用,系统自动在可穿戴设备里安装应用。然而,为了开发应用,你也可以直接安装到可穿戴设备应用之上。
Wearable apps can access much of the standard Android APIs, but don't support the following APIs:
可穿戴设备应用可以访问更多标准Android APIs,除了以下APIs:
You can check if a wearable supports a feature by calling hasSystemFeature() before trying to use an API.
你可以在使用一个API之前,调用hasSystemFeature()检查可穿戴设备是否支持该功能。
To conserve power on a wearable device, you can enable ambient mode for your Wear app. Devices transition from interactive to ambient mode when the user is idle on an activity or when the user covers the screen with their palm. Wearable apps that can transition into ambient mode are called always-on apps. The following describes the two modes of operation for always-on apps:
为了保证可穿戴设备的电量,你可以使你的Wear App适应环境。当用户的一个activity空闲时,或用户用手掌转变屏幕时,设备从与环境的交互转变模式。能够转变到环境模式的Wearable apps被always-on的应用调用。
交互 - Interactive
Use full color with fluid animation in this mode. The app is also responsive to input.
在这个mode中,使用全色彩的流动画。应用也会响应输出。
环境 - Ambient
Render the screen with grayscale graphics and do not present any input cues in this mode. This display mode is only supported on devices running Android 5.1 or higher.
在这个模组中,用灰度绘图分开屏幕,且不显示任何输入提示。该显示模组只支持运行在Android 5.1或更高版本的设备上。
On devices running versions prior to Android 5.1 or for apps that do not support ambient mode, when a user is idle on an activity or when the user covers the screen with their palm on an activity, the Wear home screen is displayed instead of your activity in ambient mode. If you need to show persistent content on versions prior to Android 5.1, create a notification in the context stream instead.
设备运行版本低于Android 5.1,或者不支持环境模式的应用,当用户的一个activity空闲时,或者用户用它们的手掌覆盖activity,Wear home screen将用环境模组中的你的activity显示来替代。如果你坚持要在Android 5.1以前的版本显示内容,在内容流中创建一个通知。
Note: We recommend using Android Studio for Android Wear development as it provides project setup, library inclusion, and packaging conveniences that aren't available in ADT. The rest of this training assumes you're using Android Studio.
注意:我们建议使用Android Studio来为安卓可穿戴设备开发,它提供项目安装、类库包含、以及打包便利器等ADT中不可用的内容。下面的训练我们假设您使用的是Android Studio。
课程 - Lessons
创建和运行一个可穿戴设备应用 - Creating and Running a Wearable App
创建自定义布局 - Creating Custom Layouts
保持你的应用的可见性 - Keeping Your App Visible
添加语音功能 - Adding Voice Capabilities
打包可穿戴设备应用 - Packaging Wearable Apps
通过蓝牙进行调试 - Debugging over Bluetooth
android wear开发之:创建可穿戴设备应用 - Creating Wearable Apps的更多相关文章
- android wear开发之:建立可穿戴设备的应用 - Building Apps for Wearables
注:本文内容来自:https://developer.android.com/training/building-wearables.html 翻译水平有限,如有疏漏,欢迎批评指教. 译:山人 建立可 ...
- android wear开发之:增加可穿戴设备功能到通知中 - Adding Wearable Features to Notifications
注:本文内容来自:https://developer.android.com/training/wearables/notifications/index.html 翻译水平有限,如有疏漏,欢迎批评指 ...
- android wear开发:为可穿戴设备创建一个通知 - Creating a Notification for Wearables
注:本文内容来自:https://developer.android.com/training/wearables/notifications/creating.html 翻译水平有限,如有疏漏,欢迎 ...
- Android安全开发之ZIP文件目录遍历
1.ZIP文件目录遍历简介 因为ZIP压缩包文件中允许存在“../”的字符串,攻击者可以利用多个“../”在解压时改变ZIP包中某个文件的存放位置,覆盖掉应用原有的文件.如果被覆盖掉的文件是动态链接s ...
- Android 安全开发之 ZIP 文件目录遍历
1.ZIP文件目录遍历简介 因为ZIP压缩包文件中允许存在"../"的字符串,攻击者可以利用多个"../"在解压时改变ZIP包中某个文件的存放位置,覆盖掉应用原 ...
- Android混合开发之WebView使用总结
前言: 今天修改项目中一个有关WebView使用的bug,激起了我总结WebView的动机,今天抽空做个总结. 混合开发相关博客: Android混合开发之WebView使用总结 Android混合开 ...
- android软件开发之webView.addJavascriptInterface循环渐进【二】
本篇文章由:http://www.sollyu.com/android-software-development-webview-addjavascriptinterface-cycle-of-gra ...
- Android底层开发之Linux输入子系统要不要推断系统休眠状态上报键值
Android底层开发之Linux输入子系统要不要推断系统休眠状态上报键值 题外话:一个问题研究到最后,那边记录文档的前半部分基本上都是没用的,甚至是错误的. 重点在最后,前边不过一些假想猜測. ht ...
- Android混合开发之WebViewJavascriptBridge实现JS与java安全交互
前言: 为了加快开发效率,目前公司一些功能使用H5开发,这里难免会用到Js与Java函数互相调用的问题,这个Android是提供了原生支持的,不过存在安全隐患,今天我们来学习一种安全方式来满足Js与j ...
随机推荐
- wpf中内置资源文件
wpf中包含三种文件类型 资源文件:编译到可执行或库 WPF 程序集中的数据文件. 内容文件:与可执行 WPF 程序集具有显式关联的独立数据文件. 源站点文件:与可执行 WPF 程序集没有关联的独立数 ...
- WPF通过代码动态的加载样式
tabitem.SetResourceReference(TabItem.StyleProperty, "mainTabItemStyle"); tabitem.Content = ...
- 数据迁移过程中hive sql调优
本文记录的是,在数据处理过程中,遇到了一个sql执行很慢,对一些大型的hive表还会出现OOM,一步一步通过参数的设置和sql优化,将其调优的过程. 先上sql ) t where t.num =1) ...
- Rythm.js 使用教程详解
转载自 http://blog.csdn.net/qq_26536483/article/details/78261515 简介 rythm.js是一款让页面元素跳动起来的插件,并且带音乐,共7种用法 ...
- Html 初识样式表&选择器
样式表&类选择器分类 样式表分类: 1.内联式样式表:在标签内部写样式代码,精确但不方便,增加工作量,后期修改麻烦. 2.嵌入式样式表:一般写在head内 以<style>.... ...
- Extjs6(四)——侧边栏导航根据路由跳转页面
本文基于ext-6.0.0 之前做的时候这个侧边栏导航是通过tab切换来切换页面的,但是总感觉不太对劲,现在终于发现怎么通过路由跳转了,分享给大家,可能有些不完善的地方,望大家读后可以给些指点.欢迎留 ...
- UVa10791 - Minimum Sum LCM
分析即为紫薯上的分析. 难点是发现当每个aipi作为一个单独的整数时才最优.. 答案就是将所有不同的 相同因子的积 相加即可 代码: #include<cstdio> #include&l ...
- (扩展根目录容量方法汇总)把Linux系统迁移到另一个分区或者硬盘
Linux系统扩容方法汇总 相信很多朋友都有过这样的经历,本想装个Ubantu玩玩,没想到玩久了反而不习惯Windows了,然而开始装系统的时候只分配了非常小的空间,那应该怎样扩展我们的ubantu呢 ...
- call()与apply() 改变this指向
p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Consolas; color: #a5b2b9 } span.Apple-tab-span ...
- 【译】10分钟学会Pandas
十分钟学会Pandas 这是关于Pandas的简短介绍主要面向新用户.你可以参考Cookbook了解更复杂的使用方法 习惯上,我们这样导入: In [1]: import pandas as pd I ...