转自:
http://galin.blog.sohu.com/170489657.html
AndroidManifest.xml的Service元素
<service android:name=".RemoteService" android:process=":remote">
<intent-filter>
<action android:name="com.demo.IMyService" />
</intent-filter>
</service>
这里的android:process=":remote",一开始我没有添加的,在同一个程序里使用IPC,即同一个程序作为客户端/服务器端,结果运行mRemoteService = IMyService.Stub.asInterface(service);时提示空指针异常。观察了人家的在不同程序里进行IPC的代码,也是没有这个android:process=":remote"的。后来在官方文档http://androidappdocs.appspot.com/guide/topics/manifest/service-element.html里了解到(留意第二段文字):
android:process
The name of the process where the service is to run. Normally, all components of an application run in the default process created for the application. It has the same name as the application package. The <application> element's process attribute can set a different default for all components. But component can override the default with its own process attribute, allowing you to spread your application across multiple processes.
If the name assigned to this attribute begins with a colon (':'), a new process, private to the application, 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 in a global process of that name, provided that it has permission to do so. This allows components in different applications to share a process, reducing resource usage.
也就是说android:process=":remote",代表在应用程序里,当需要该service时,会自动创建新的进程。而如果是android:process="remote",没有“:”分号的,则创建全局进程,不同的应用程序共享该进程。
转自:
http://blog.csdn.net/fireofstar/article/details/7583047
分享到:
相关推荐
AndroidManifest.xml文件详解 AndroidManifest android java
Android 报错:Entry name ‘AndroidManifest.xml’ collided前言解决方法1、直接退回3.5.32、排除打包文件3、使用旧打包工具4、最终解决方法完事 前言 这两天 Android studio 更新了 3.6 版本,天天在右下角提示 ...
一个解密apk 包中AndroidManifest.xml 的工具,命令行直接使用,生成一个明文的xml 文件。 AndroidManifestConver.exe c:\src.xml c:\dest.xml
apk主配置AndroidManifest.xml信息查看工具,只要将apk文件拖到AppInfo.bat上面即可,另外dex-method-count.bat能计算apk包含的方法数
AndroidManifest.xml反编译工具,包含工具和使用方法。
几个批处理文件,用来自动批量提取apk文件中的AndroidManifest.XML文件
本文件用来修改二进制文件AndroidManifest.xml的内容!!!
Android教程之AndroidManifest.xml文件 详细介绍及用法解析
上次传的main activity代码配套,欢迎页面太丑没穿,好吧,就这样。
androidmanifest 文件 基础 解读 入门,讲解androidmanifest.xml的相关知识
详细阐述androidmanifest.xml各个属性的含义和用法
使用Java语言实现将AndroidManifest.xml编译成特定的二进制文件。
androidmanifest.xml分析工具,将文件与androidmanifest.xml放在同一目录下运行python XMLanalysis.py即可
Android学习笔记之AndroidManifest.xml文件解析
AndroidManifest.xml 是每个android程序中必须的文件。它位于整个项目的根目录,描述了package中暴露的组件(activities, services, 等等),他们各自的实现类,各种能被处理的数据和启动位置。 除了能声明程序中的...
android反编译:修改apk生成的二进制文件AndroidManifest.xml文件。
Android教程之AndroidManifest.xml
android系统AndroidManifest.xml文件解析,供参考。
详细剖析 androidmanifest.xml 文件,罗列各节点,属性的作用,非常值得参考!!!