Android API文档翻译——Service
来源:互联网 发布:两棵枣树 知乎 编辑:程序博客网 时间:2024/05/17 03:34
概述:
声明一个Service(或其子类)组件。与Activity不同的是,Service是非可见的。他们常用于实现长驻后台的操作或为其他Application提供类似WebService的交互接口。
所有的Service必须在manifest配置文件中通过<service>标签来声明。如果没有声明的话,则不会在system中看到,而且永远不能被运行。
参数:
android:enabled
Service是否能被系统初始化,默认为true。(具体什么叫被系统初始化,还需要研究)
<application> and<service> 的enable属性必须都为true,该Service才能被系统初始化,缺一不可。 当然,默认情况下就是true,所以一般也不用设置。
android:exported
标识该组件是否可以被其他应用程序调用,或者与其交互。
该参数的默认值取决于<service>是否包含<intent-filter>,如果不包含,则默认值为false,反之则为true。
这个参数并不是唯一可以限制Service入口的参数。你也可以使用permission权限控制来达到相同的目的。
android:icon
说白了就是在进程菜单中显示该Service的Logo。
android:label
说白了就是在进程菜单中显示该Service的Name。
android:name
就是你的implements了Service类的实现类。他既可以是一个类全名,也可以只包含类名。注意:该属性没有默认值,必须被明确声明。
android:permission
标识此Service的调用权限,如果没有设置,则默认使用<application>的权限设置。
android:process
标识该Service将运行在哪个进程中。一般来说,所有的组件都会默认运行在创建它们的Application中,名称跟包名相同。(设置为system是什么意思?)
If the name assigned tothis attribute begins with a colon (':'), a new process, private to theapplication, is created when it's needed and the service runs in that process.If the process name begins with a lowercase character, the service will run ina global process of that name, provided that it has permission to do so. Thisallows components in different applications to share a process, reducingresource usage.
- Android API文档翻译——Service
- Service API文档 翻译
- android service (官方文档翻译)
- Android Api Component---翻译Service
- Android Api Component---翻译Bound Service
- 【Android应用开发】RecycleView API 翻译 (文档翻译)
- Service官方文档翻译
- Android—API中文文档
- service API and 翻译
- [翻译]API Guides - Service
- service [翻译]API Guides
- CNTK API文档翻译(1)——使用数列
- CNTK API文档翻译(2)——逻辑回归
- CNTK API文档翻译(3)——前馈神经网络
- CNTK API文档翻译(4)——MNIST数据加载
- CNTK API文档翻译(12)——CNTK进阶
- CNTK API文档翻译(14)——实验图像识别
- CNTK API文档翻译(15)——自然语言理解
- PhoneGap简介
- Android平台实现https信任所有证书的方法
- Android_Activity和Intent
- 转发至新浪微博、开心网、腾讯微博、人人网代码分享!
- Eclipse使用Git代替CVS与SVN实现版本管理
- Android API文档翻译——Service
- CuteEditor 使用详解
- 关于webwork+freemarker的简单实例
- 2011-1.21--1.30新年第四周
- 通讯录添加新纪录
- Hibernate中Cascade和Inverse简述
- android抽屉实现
- mstsc.exe的小插件,隐藏客户端计算机名
- 基于funambol ds 的云同步服务研究(四)-源码的研究摘记