android xml通知栏权限配置,Android开发中 AndroidManifest.xml配置之service,receiver标签配置详解...

本文主要来分享service,receiver标签配置。如有错误,欢迎指正。

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" >

. . .

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运行的进程名称。

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中的配置与Service中的配置相似,不做多解析。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
极光通知是一种Android推送通知服务,它可以帮助应用程序在后台向用户发送通知消息。使用极光通知,应用程序可以轻松地向用户发送推送通知,提醒他们有新的消息、新的活动或新的优惠等。 具体使用方法如下: 1. 在项目添加极光推送 SDK。 2. 在 AndroidManifest.xml 文件注册 JPush SDK。 ``` <receiver android:name="cn.jpush.android.service.PushReceiver" android:enabled="true" > <intent-filter> <action android:name="cn.jpush.android.intent.RECEIVE_MESSAGE" /> <action android:name="cn.jpush.android.intent.REGISTRATION" /> <action android:name="cn.jpush.android.intent.UNREGISTRATION" /> <action android:name="cn.jpush.android.intent.MESSAGE_RECEIVED" /> <action android:name="cn.jpush.android.intent.NOTIFICATION_RECEIVED" /> <action android:name="cn.jpush.android.intent.NOTIFICATION_OPENED" /> <action android:name="cn.jpush.android.intent.ACTION_RICHPUSH_CALLBACK" /> <category android:name="com.example.jpushdemo" /> </intent-filter> </receiver> ``` 3. 初始化 JPush SDK。 ``` JPushInterface.init(this); ``` 4. 设置通知样式。 ``` // 设置通知样式 - 定义通知Layout private void setStyleCustom() { CustomPushNotificationBuilder builder = new CustomPushNotificationBuilder(MainActivity.this, R.layout.customer_notitfication_layout, R.id.icon, R.id.title, R.id.text); builder.layoutIconDrawable = R.drawable.jpush_notification_icon; builder.developerArg0 = "developerArg2"; JPushInterface.setPushNotificationBuilder(2, builder); } ``` 5. 发送通知。 ``` JPushInterface.sendNotification(MainActivity.this, R.layout.customer_notitfication_layout, R.id.icon, R.id.title, R.id.text, pushPayload); ``` 以上是使用极光通知的简单步骤,具体可参考极光官方文档。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值