四大组件之Service
2015-11-23 14:30
120 查看
A
an application component that can perform long-running operations in the background and does not provide a user interface. Another application component can start a service and it will continue to run in the background even if the user switches to another
application. Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service might handle network transactions, play music, perform file I/O, or interact with a content provider,
all from the background.
服务是可以在后台执行长时间运行操作,并且不提供用户界面的应用组件。另一个应用程序组件可以启动服务,它将继续存在即使用户切换到另一个应用程序在后台运行。此外,一个组件可以绑定到一个服务来与它交流,甚至进行进程间通信(IPC)。例如,服务可能处理网络交易,播放音乐,执行文件I / O,或与Content Provider进行交互,所有都是从后台运行
A service can essentially take two forms:
服务基本上可以采取两种形式:
StartedA service is "started" when an application component (such as an activity) starts it by calling
Once started, a service can run in the background indefinitely, even if the component that started it is destroyed. Usually, a started service performs a single operation and does not return a result to the caller. For example, it might download or upload
a file over the network. When the operation is done, the service should stop itself.
Started
服务的“启动”当应用程序组件(如Activity)通过调用startService启动它,一旦开始,一个服务可以在后台运行下去,即使启动它的组件被破坏。一般,服务执行单次操作,其结果不返回给调用者。例如,它可以下载或上传文件在网络上。当操作完成时,服务应停止本身。
Serviceis
an application component that can perform long-running operations in the background and does not provide a user interface. Another application component can start a service and it will continue to run in the background even if the user switches to another
application. Additionally, a component can bind to a service to interact with it and even perform interprocess communication (IPC). For example, a service might handle network transactions, play music, perform file I/O, or interact with a content provider,
all from the background.
服务是可以在后台执行长时间运行操作,并且不提供用户界面的应用组件。另一个应用程序组件可以启动服务,它将继续存在即使用户切换到另一个应用程序在后台运行。此外,一个组件可以绑定到一个服务来与它交流,甚至进行进程间通信(IPC)。例如,服务可能处理网络交易,播放音乐,执行文件I / O,或与Content Provider进行交互,所有都是从后台运行
A service can essentially take two forms:
服务基本上可以采取两种形式:
StartedA service is "started" when an application component (such as an activity) starts it by calling
startService().
Once started, a service can run in the background indefinitely, even if the component that started it is destroyed. Usually, a started service performs a single operation and does not return a result to the caller. For example, it might download or upload
a file over the network. When the operation is done, the service should stop itself.
Started
服务的“启动”当应用程序组件(如Activity)通过调用startService启动它,一旦开始,一个服务可以在后台运行下去,即使启动它的组件被破坏。一般,服务执行单次操作,其结果不返回给调用者。例如,它可以下载或上传文件在网络上。当操作完成时,服务应停止本身。
相关文章推荐
- iOS企业版程序发布--升级
- LeetCode OJ 系列之217 Contains Duplicate --Python
- QT数据库实例操作(二)
- Ⅰ.9 如何创建查询用户输入的半自动化测试
- angularJS学习之路(十三)---ng-change
- 未在本地计算机上注册“microsoft.ACE.oledb.12.0”提供程序解决办法
- 053-7 When executing a SQL workload, you choose to generate execution plans only, without collecting
- MessageBox函数
- UIButton文字的显示位置,字体的大小
- linux 进程学习笔记-进程pipe管道
- [自动化-脚本]002.cocos2dx-lua lua代码windows加密批处理
- 图像旋转
- 不符合该安装程序的以下最小系统需求
- Android应用启动优化:一种DelayLoad的实现和原理(转)
- 程序:从标准输入读取几行输入,每行输入都要打印到标准输出上,前面要加上行号。
- Java环境变量的配置
- Java环境变量的配置
- Java环境变量的配置
- Java环境变量的配置
- zebra之间的通讯