android intentservice可以绑定吗,android – 你可以在一个单独的进程启动IntentService吗?...

1) Is it possible to start an IntentService on a separate process? How? If so, is it mandatory to bind to it?

是的,您可以在单独的进程中启动IntentService。只需将android:process =“:whatever”添加到该服务的清单条目。

不,你不需要绑定它。您可以通过使用startService()发送Intent来进行通信

2) Is it possible to start an IntentService on a separate process AND run it in the foreground?

是(见上文)。要使您的服务在前台运行,它可以在需要时调用startForeground()。服务本身可以控制是否在前台或后台运行。

3) What’s the difference between android:isolatedProcess and android:process? See: 07000

android:进程允许您控制每个特定组件在哪个进程中运行(通过指定进程的名称)。您可以将应用程序的组件分组在单独的进程中运行(例如,一个进程中的所有UI组件以及另一个进程中的所有服务)。默认行为是应用程序的所有组件在同一进程中运行。

android:isolationProcess是一个标志(true / false),您可以设置一个特定的服务组件在与其他应用程序隔离的单独进程中运行。隔离的进程没有授予您的其余应用程序的任何权限。通常,权限被授予应用程序,应用程序的所有组件都具有应用程序获得的所有权限。 android:isolationProcess只能从API级别16(Jellybean)开始。见http://aleksmaus.blogspot.de/2012/09/a-feature-of-android-jelly-bean.html和Advantage of introducing Isolatedprocess tag within Services in JellyBean[Android]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值