怎么设置彩虹岛答题奖励励?还有怎么看自己百度云的ID?

百度云。求拉我入群 男人 看的东西 知道?_百度知道
百度云。求拉我入群 男人 看的东西 知道?
我有更好的答案
资源享互换
你云号多少?
寂寞小王子520
😂女的都看得懂
接受付费吗
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁谁的百度云有男人喜欢看的,求加好友,分享于我,谢谢_百度知道
谁的百度云有男人喜欢看的,求加好友,分享于我,谢谢
提问者采纳
加我百度云看我玫瑰
好的明天8点帐号加 看我玫瑰就行了
不见不散哦!!
快到了,8点发帐号来,不要名字,太难搜了
叫 看我玫瑰
提问者评价
太给力了,你的回答完美地解决了我的问题,非常感谢!
其他类似问题
你好楼主因在百度知道发送资源链接容易失效。所以不在百度知道上面发送资源链接。为了避免链接失效请直接加为百度云好友。不要发百度私信给我,我不看百度私信, 请直接加百度云好友,我给你发送资源。百度ID:ID:house蓝宇水瓶
怎么(⊙_⊙?)
不要名字,要帐号
怎么(⊙_⊙?)
为您推荐:
加好友的相关知识
其他1条回答
如果没时间,明早也行
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁&uses-permission android:name="android.permission.INTERNET" />
&uses-permission android:name="android.permission.READ_PHONE_STATE" />
&uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
&uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
&uses-permission android:name="android.permission.WRITE_SETTINGS" />
&uses-permission android:name="android.permission.VIBRATE" />
&uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
&uses-permission android:name="android.permission.ACCESS_DOWNLOAD_MANAGER"/>
&uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
&uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
&uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
&uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
&uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
&!-- 4.6版本新增的Activity声明,提升Push后台存活率 -->
android:name="com.baidu.android.pushservice.PushKeepAlive"
android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
&!-- push service start -->
&!-- 用于接收系统消息以保证PushService正常运行 -->
&receiver android:name="com.baidu.android.pushservice.PushServiceReceiver"
android:process=":bdservice_v1" >
&intent-filter>
&action android:name="android.intent.action.BOOT_COMPLETED" />
&action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
&action android:name="com.baidu.android.pushservice.action.notification.SHOW" />
&action android:name="com.baidu.android.pushservice.action.media.CLICK" />
&!-- 以下四项为可选的action声明,可大大提高service存活率和消息到达速度 -->
&action android:name="android.intent.action.MEDIA_MOUNTED" />
&action android:name="android.intent.action.USER_PRESENT" />
&action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
&action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
&/intent-filter>
&/receiver>
&!-- Push服务接收客户端发送的各种请求-->
&receiver android:name="com.baidu.android.pushservice.RegistrationReceiver"
android:process=":bdservice_v1" >
&intent-filter>
&action android:name="com.baidu.android.pushservice.action.METHOD" />
&action android:name="com.baidu.android.pushservice.action.BIND_SYNC" />
&/intent-filter>
&intent-filter>
&action android:name="android.intent.action.PACKAGE_REMOVED" />
&data android:scheme="package" />
&/intent-filter>
&/receiver>
&service android:name="com.baidu.android.pushservice.PushService" android:exported="true"
android:process=":bdservice_v1" >
&intent-filter >
&action android:name="com.baidu.android.pushservice.action.PUSH_SERVICE" />
&/intent-filter>
&/service>
&!-- 4.4版本新增的CommandService声明,提升小米和魅族手机上的实际推送到达率 -->
&service android:name="com.baidu.mandService"
android:exported="true" />
&!-- push结束 -->
启动云推送
在当前工程的主Activity的onCreate函数中,添加以下代码:
PushManager.startWork(getApplicationContext(),PushConstants.LOGIN_TYPE_API_KEY,"api_key")
其中的“API Key“需要手动修改为指定应用的API Key。
自定义回调类
在当前工程中新建一个类,右键点击选择new
Class,填写接收云推送回调信息和推送到达信息的类的类名,并点击Finish创建该类文件(本例中使用PushTestReceiver)。
打开新创建的类,继承PushMessageReceiver,此时类名飘红,移动到类名上,点击 Add unimplemented methods,重载所有的回调函数,并打印对应信息,如图所示:
在当前工程的AndroidManifest.xml文件中,添加自定义Receiver信息如下:
&!-- 此处Receiver名字修改为当前包名路径 -->
&receiver android:name="com.*.*.PushTestReceiver">
&intent-filter>
&!-- 接收push消息 -->
&action android:name="com.baidu.android.pushservice.action.MESSAGE" />
&!-- 接收bind、setTags等method的返回结果-->
&action android:name="com.baidu.android.pushservice.action.RECEIVE" />
&!-- 接收通知点击事件,和通知自定义内容 -->
&action android:name="com.baidu.android.pushservice.action.notification.CLICK" />
&/intent-filter>
&/receiver>
右键点击当前工程,选择Run As
Android Application,选中已连接的设备或Android虚拟机,运行该程序。如果在logcat中的回调函数中的errorCode为0,说明已经绑定成功,并返回userid和channelid,我们就可以在云控制台推送通知和透传消息到该app了。
处理推送消息
在集成SDK后,可以通过以下两种方式推送消息。
通过控制台推送消息。参见:
通过服务端SDK推送消息,目前服务端提供
两种语言的SDK,其它语言可以通过包装RestAPI使用云推送服务,具体可参见 。
接收通知消息
当设备接收到通知消息后,查看手机的通知栏,可以看到通知栏内的新通知展示。如图:
通知到达时,当通知被用户点击时,会回调onNotificationClicked函数。
推送透传消息
当设备接收到透传消息时,消息不会在通知栏展示,只是静默回调开发者自定义Receiver中的onMessage函数。手机收到消息后不会有任何现象,因为透传消息对用户完全透明,用户无法感知,便于开发者在不影响用户的情况下对app进行操作。开发者可以通过log内容和自定义的回调函数onMessage中打印该内容,确认消息到达,并执行开发者指定操作。
错误码说明
error_code
当前网络不可用,请检查网络
服务不可用,连接server失败
服务不可用,503错误
应用集成方式错误,请检查各项声明和权限
服务内部错误
非法函数请求,请检查您的请求内容
请求参数错误,请检查您的参数
非法构造请求,服务端验证失败
请求的数据在服务端不存在
绑定关系不存在或未找到
一个百度账户绑定设备超出个数限制(多台设备登录同一个百度账户)
百度账户绑定应用时被禁止,需要白名单授权
如果需要混淆app,请在混淆文件(一般默认为Android工程下proguard-project.txt或者proguard.cfg)中添加以下说明(pushservice-VERSION.jar为集成的jar包名字,VERSION为版本名称),防止SDK内容被二次混淆,无法收到消息。
-libraryjars libs/pushservice-VERSION.jar
-dontwarn com.baidu.**
-keep class com.baidu.**{*; }
本SDK中有四个重要的开放类,分别为:PushManager、PushSettings、BasicPushNotificationBuilder和CustomPushNotificationBuilder,另外还有常量类PushConstants和回调接收类PushMessageReceiver。
PushManager
提供了所有使用Push服务的静态方法
PushSettings
提供了端上Push服务的配置静态方法
BasicPushNotificationBuilder
用于定制 Android Notification 里的基础样式和行为
CustomPushNotificationBuilder
用于定制 Android Notification 里的 sound / flags / icon,以及通知栏的layout、图标和状态栏图标
PushConsants
SDK对外的常量定义
PushMessageReceiver
自定义接收push消息和通知实现的直接父类
接口与方法
Push Android SDK目前支持以下接口:
API函数原型
Push服务接口
提供Push服务
startWork, stopWork, resumeWork
Tag管理接口
Tag的创建与删除
setTags, delTags, onListTags
通知管理接口
自定义通知样式
CustomPushNotificationBuilder,
BasicPushNotificationBuilder, setNotificationFlags,
setNotificationDefaults, setStatusbarIcon,
setLayoutDrawable, setNotificationSound, setNotificationBuilder
Push服务设置
enableDebugMode
LBS推送接口
打开或关闭精确LBS推送
enableLbs, disableLbs
异步消息处理接口
Push消息处理receiver
onBind, onMessage, onNotificationClicked, onNotificationArrived, onSetTags, onDelTags, onListTags, onUnbind
Push服务初始化及绑定-- startWork
public static void startWork(Context context, int loginType, String loginValue);
PushManager类定义的静态方法,完成Push服务的初始化,并且自动完成bind工作。
context:当前执行Context
loginType:绑定认证方式(无账号认证方式用PushConstants.LOGIN_TYPE_API_KEY,百度Auth2.0认证方式用PushConstants.LOGIN_TYPE_ACCESS_TOKEN)
loginValue:和loginType对应,分别是应用的API Key,或者百度Auth2.0 Access
通过com.baidu.android.pushservice.action.RECEIVE Intent发送给客户端receiver,Intent extra PushConstants.EXTRA_CONTENT 包含返回字符串,为json格式,如:
"request_id":,
"response_params":
"appid": "",
"user_id":"345678",
"channel_id":"6872165"
user_id 系统返回的绑定Baidu Channel的用户标识
appid 系统返回的应用标识
channel_id 系统返回的设备连接的通道标识
如果您通过服务端接口(REST或SDK)向百度Push服务推送消息,bind成功后需要channel_id和access token(或者appid + user_id)传给应用的服务器,以便您的服务器向百度Push服务推送消息。如果只使用管理控制台来发送消息,可以不用关心这些返回信息。
注意:不要在Application的onCreate里去做startWork的操作。
停止和恢复Push服务-- stopWork、resumeWork
public static void stopWork(Context context);
PushManager类定义的静态方法,停止本应用Push服务进程,并且完成unbind工作。startWork和resumeWork都会重新开启本应用Push功能。
context:当前执行Context
public static void resumeWork(Context context);
PushManager类定义的静态方法,恢复本应用Push服务,并且再次完成bind工作。
context:当前执行Context
查询push是否被停止的接口-- isPushEnabled
public static boolean isPushEnabled(Context context);
PushManager类定义的静态方法,查询push是否已经被停止。
context:当前执行Context
public static void setTags(Context context, List tags);
PushManager类定义的静态方法,用于设置标签;成功设置后,可以从管理控制台或您的服务后台,向指定的设置了该tag的一群用户进行推送。
注意:tag设置的前提是已绑定的端,也就是应用有运行过startWork或bind,且在onBind回调中返回成功。
tags :包含多个标签字符串的List
通过com.baidu.android.pushservice.action.RECEIVE Intent发送给客户端receiver,Intent extra PushConstants.EXTRA_CONTENT 包含返回字符串,json格式:
"request_id":,
"response_params":
success_amount:1,
"tag":"abc",
"result":0
"tag":"def",
"result":1
public static void delTags(Context context, List tags);
PushManager类定义的静态方法,用于删除标签。
tags :包含多个标签字符串的List
通过com.baidu.android.pushservice.action.RECEIVE Intent发送给客户端receiver,Intent extra PushConstants.EXTRA_CONTENT 包含返回字符串,json格式:
"request_id":,
"response_params":
success_amount:1,
"tag":"abc",
"result":0//成功
"tag":"def",
"result":1//失败
设置通知的Builder -- setNotificationBuilder
public static void setNotificationBuilder(Context context, int id, PushNotificationBuilder notificationBuilder);
PushManager类定义的静态方法,设置通知栏样式,并为样式指定编号。在管理控制台或您的服务后台中,您可以指定相应的编号,让客户端显示预先设定好的样式。
context :android app运行上下文
id :notificationBuilder编号,开发者自己维护
notificationBuilder :通知栏构建类
设置默认的通知Builder-- setDefaultNotificationBuilder
public static void setDefaultNotificationBuilder(Context context, PushNotificationBuilder notificationBuilder);
PushManager类定义的静态方法,设置默认的通知栏样式;如果推送通知时不指定id的样式,都将显示该默认样式。
Context :android app运行上下文
notificationBuilder :通知栏构建类
设置富媒体通知的Builder-- setMediaNotificationBuilder
public static void setMediaNotificationBuilder(Context context, PushNotificationBuilder notificationBuilder);
PushManager类定义的静态方法,为富媒体通知设置样式;用法和自定义通知样式相似。
自定义通知Builder-- BasicPushNotificationBuilder
BasicPushNotificationBuilder();
自定义通知状态栏构建类构造函数(定制通知栏基础样式) 。
自定义通知Builder-- CustomPushNotificationBuilder
CustomPushNotificationBuilder(layoutId, layoutIconId, layoutTitleId, layoutTextId);
自定义通知状态栏构建类构造函数(定制通知栏基础样式及layout)。
layoutId :自定义layout资源id
layoutIconId :自定义layout中显示icon 的id
layoutTitleId :自定义layout中显示标题的id
layoutTextId :自定义layout中显示内容的id
设置通知flags-- setNotificationFlags
public void setNotificationFlags (int flags);
基类PushNotificationBuilder定义的方法,定制 Android Notification 里的flags。
flags :Android Notification flags
设置通知defaults-- setNotificationDefaults
public void setNotificationDefaults (int defaults);
基类PushNotificationBuilder定义的方法,定制 Android Notification 里的defaults。
defaults :Android Notification defaults
设置通知状态栏icon-- setStatusbarIcon
public void setStatusbarIcon (int icon);
基类PushNotificationBuilder类定义的方法,定制 Android Notification通知状态栏的icon图标。
icon :图标资源id
设置通知样式图片-- setLayoutDrawable
public void setLayoutDrawable(int drawableId);
CustomPushNotificationBuilder类定义的方法,定制自定义layout中显示的图片。
drawableId :图标资源id
设置通知样式声音-- setNotificationSound
public void setNotificationSound(String soundId);
CustomPushNotificationBuilder类定义的方法,自定义推送的声音。
soundId :声音资源路径
开启调试模式-- enableDebugMode
public static void enableDebugMode(boolean debugEnabled);
PushSettings类定义的方法,开启调试模式,会输出调试Log。
注意:发布应用时,请不要开启调试模式,否则会降低Push性能。
debugEnabled :true打开调试模式,false关闭调试模式。
开启精确LBS推送模式-- enableLbs
public static void enableLbs(Context context);
PushManager类定义的方法,开启精确LBS推送模式,覆盖最近半小时内在指定区域出现过的终端。
Context :android app运行上下文
关闭精确LBS推送模式-- disableLbs
public static void disableLbs(Context context);
PushManager类定义的方法,关闭精确LBS推送模式,关闭后,服务端将无法有效发送基于地理位置的定向推送。
Context :android app运行上下文
获取绑定请求的结果-- onBind
public void onBind(Context context, int errorCode, String appid, String userId, String channelId, String requestId);
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。调用PushManager.startWork后,sdk将对push server发起绑定请求,这个过程是异步的。绑定请求的结果通过onBind返回。
如果您需要用单播推送,需要把这里获取的channel id和user id上传到应用server中,再调用server接口用channel id和user id给单个手机或者用户推送。
BroadcastReceiver的执行Context
errorCode 绑定接口返回值,0 - 成功
应用id,errorCode非0时为null
应用user id,errorCode非0时为null
应用channel id,errorCode非0时为null
requestId 向服务端发起的请求id,在追查问题时有用
接收透传消息的函数-- onMessage
public void onMessage(Context context, String message, String customContentString);
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。接收透传消息。
context 上下文
message 推送的消息
customContentString 自定义内容,为空或者json字符串
接收通知点击的函数-- onNotificationClicked
public void onNotificationClicked(Context context, String title, String description, String customContentString)
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。接收通知点击的函数。
context 上下文
title 推送的通知的标题
description 推送的通知的描述
customContentString 自定义内容,为空或者json字符串
接收通知到达的函数-- onNotificationArrived
public void onNotificationArrived(Context context, String title, String description, String customContentString)
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。接收通知到达的函数。
context 上下文
title 推送的通知的标题
description 推送的通知的描述
customContentString 自定义内容,为空或者json字符串
public void onSetTags(Context context, int errorCode, List sucessTags, List failTags, String requestId);
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。setTags() 的回调函数。
context 上下文
errorCode 错误码,0表示某些tag已经设置成功,非0表示所有tag的设置均失败
successTags 设置成功的tag
failTags 设置失败的tag
requestId 分配给对云推送的请求的id
public void onDelTags(Context context, int errorCode, List sucessTags, List failTags, String requestId)
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。delTags() 的回调函数。
context 上下文
errorCode 错误码。0表示某些tag已经删除成功;非0表示所有tag均删除失败
successTags 成功删除的tag
failTags 删除失败的tag
requestId 分配给对云推送的请求的id
public void onListTags(Context context, int errorCode, List tags, String requestId);
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。listTags() 的回调函数。
context 上下文
错误码。0表示列举tag成功;非0表示失败
tags 当前应用设置的所有tag
requestId 分配给对云推送的请求的id
stopWork的回调函数-- onUnbind
public void onUnbind(Context context, int errorCode, String requestId);
PushMessageReceiver的抽象方法,把receiver类继承PushMessageReceiver可以使用。PushManager.stopWork() 的回调函数。
context 上下文
errorCode 错误码,0表示从云推送解绑定成功,非0表示失败
requestId 分配给对云推送的请求的id
Android SDK的常量定义都在PushConstants类中。
如:Push发送给应用的Action的常量,都是String类型
ACTION_MESSAGE
接收消息时使用。
ACTION_RECEIVE
获取方法调用的返回值,包括绑定、设置Tag、删除Tag等方法。
ACTION_RECEIVER_NOTIFICATION_CLICK
通知点击事件的截获。
注意:通知发出时,应用从Intent中获取Extra的常量,均为String类型
EXTRA_PUSH_MESSAGE_STRING
消息内容,在ACTION_MESSAGE中使用。Extra获取方法
intent.getStringExtra(PushConstants.EXTRA_PUSH_MESSAGE_STRING)
EXTRA_METHOD
方法名,在ACTION_RECEIVE中使用。Extra获取方法
intent.getStringExtra(PushConstants.EXTRA_METHOD)
EXTRA_ERROR_CODE
方法错误码,在ACTION_RECEIVE中使用。Extra获取方法
intent.getIntExtra(PushConstants.EXTRA_ERROR_CODE)
EXTRA_CONTENT
方法返回内容,在ACTION_RECEIVE中使用。Extra获取方法
intent.getByteArrayExtra(PushConstants.EXTRA_CONTENT)
EXTRA_NOTIFICATION_TITLE
通知标题,在ACTION_RECEIVER_NOTIFICATION_CLICK中使用。Extra获取方法
intent.getStringExtra(PushConstants.EXTRA_NOTIFICATION_TITLE)
EXTRA_NOTIFICATION_CONTENT
通知内容,在ACTION_RECEIVER_NOTIFICATION_CLICK中使用。Extra获取方法
intent.getStringExtra(PushConstants.ACTION_RECEIVER_NOTIFICATION_CLICK)
方法名常量,都是String类型
绑定方法名,在EXTRA_METHOD中取得的值是这三者之一。

我要回帖

更多关于 神武烧烤答题奖励 的文章

 

随机推荐