本文主要来分享service,receiver标签配置。如有错误,欢迎指正。
更多Android技术分享可以关注我的Android技术圈子,也可以join in 扣扣群:690347536,交流Android开发技能。
<service android:description="string resource"
android:directBootAware=["true" | "false"]
android:enabled=["true" | "false"]
android:exported=["true" | "false"]
android:foregroundServiceType=["connectedDevice" | "dataSync" |
"location" | "mediaPlayback" | "mediaProjection" |
"phoneCall"]
android:icon="drawable resource"
android:isolatedProcess=["true" | "false"]
android:label="string resource"
android:name="string"
android:permission="string"
android:process="string" >
. . .
</service>
android:description
service的描述文字。android:directBootAware
是否在用户解锁时直接启动。android:enabled
是否可以被Android系统实例化。android:exported
是否可以跟其他应用的组件直接交互。android:foregroundServiceType
指定该服务是满足特定用例的前台服务。android:icon
代表Service的图标。android:isolatedProcess
如果设置为true,则此服务将在与系统其余部分隔离的特殊进程中运行,并且没有自己的权限,与它的唯一通信只能通过Service API(绑定和启动)。android:label
可以显示给用户的服务标签。android:name
实现Service子类的完全类名。android:permission
访问Service必须的权限。android:process
Service运行的进程名称。
<receiver android:directBootAware=["true" | "false"]
android:enabled=["true" | "false"]
android:exported=["true" | "false"]
android:icon="drawable resource"
android:label="string resource"
android:name="string"
android:permission="string"
android:process="string" >
. . .
</receiver>
receiver中的配置与Service中的配置相似,不做多解析。
更多Android技术分享可以关注我的Android技术圈子,也可以join in 扣扣群:690347536,交流Android开发技能。