Should I use android: process =“:remote” in my reciver?
来源:互联网 发布:仅展示三天朋友圈知乎 编辑:程序博客网 时间:2024/06/08 12:27
By defining your receiver withandroid:process=":remote" you basically run your receiver in adifferent process (= VM). For typical use-cases, you don't need to runthis in a different process, and whatever you want to do can probablyrun just fine locally (in your APK process).
The drawbacks of using android:process=":remote" is that you needadditional resources for it to run (in this case a seperate process).When doing so, you're basically dealing with 2 VMs, and some patternslike singletons, static fields can no longer be shared between your appand your remote service.
The benefits of using android:process=":remote" is that for someuse-cases, it might be handy to start a service that will keep onrunning (in its own process) after you've shutdown your application, orif you want remote clients to be able to bind to your service. Yourbroadcast receiver will not block your applications main thread whenrunning in a seperate process upon calling the onReceive method(however, there are other ways of implementing this.
I've found that most of the time, for most common use-cases, you can get away without using android:process="remote"
- Should I use android: process =“:remote” in my reciver?
- Which should I use in my DTD, attributes or elemen
- What url should I use to verify my receipt in In-App Purchase
- android:process=":remote"
- android:process=":remote" .
- android:process=":remote"
- android:process=":remote" .
- android:process=":remote"
- android:process=":remote"
- android:process=":remote"
- android:process=":remote"
- In my life, I should optimism face to everything!
- Why / When / How should I use exception in Python ?
- android:process=":remote"属性
- When should I use == and when should I use Equals?
- When should I use /text() at the end of my XPath expression?
- Which Extension Should I Use?
- When should I use shutdown()?
- kernel: cciss: fifo full
- Linux中TASK_RUNNING状态的进程链表
- Xen 虚拟化背景知识
- 利用Python统计源代码行数以及对源代码排版
- 简明 Vim 练级攻略
- Should I use android: process =“:remote” in my reciver?
- 使用EGL Rich UI访问数据库(5-8课)
- Xen 工作原理与体系架构
- 浅谈移动互联网广告设计
- 解决Beyond Compare中文乱码的问题
- Google Protobuf的使用
- 对象
- php 异步执行
- 排序最全实例C++