华为HarmonyOS打造开放、合规的广告生态 - 贴片广告
场景介绍
贴片广告是一种在视频播放前、视频播放中或视频播放结束后插入的视频或图片广告。
接口说明
接口名 | 描述 |
---|---|
loadAd(adParam: AdRequestParams, adOptions: AdOptions, listener: AdLoadListener): void | 请求单广告位广告,通过AdRequestParams、AdOptions进行广告请求参数设置,通过AdLoadListener监听广告请求回调。 |
AdComponent(ads: advertising.Advertisement[], displayOptions: advertising.AdDisplayOptions, interactionListener: advertising.AdInteractionListener, @BuilderParam adRenderer?: () => void): void | 展示广告,通过AdDisplayOptions进行广告展示参数设置,通过AdInteractionListener监听广告状态回调。 |
开发步骤
- 获取OAID。
如果想要为用户更精准的推送广告,可以在请求参数AdRequestParams中添加oaid属性。
如何获取OAID参见获取OAID信息。
说明
使用以下示例中提供的测试广告位必须先获取OAID信息。
- 请求单广告位广告。
需要创建一个AdLoader对象,通过AdLoader的loadAd方法请求广告,最后通过AdLoadListener来监听广告的加载状态。
在请求贴片广告时,需要在AdOptions中设置两个参数:totalDuration和placementAdCountDownDesc。
请求广告关键参数如下所示:
示例代码如下所示:请求广告参数名
类型
必填
说明
adType
number
是
请求广告类型,贴片广告类型为60。
adId
string
是
广告位ID。
- 如果仅调测广告,可使用测试广告位ID:testy3cglm3pj0。
- 如果要接入正式广告,则需要申请正式的广告位ID。可在应用发布前进入流量变现官网,点击“开始变现”,登录鲸鸿动能媒体服务平台进行申请,具体操作详情请参见展示位创建。
oaid
string
否
开放匿名设备标识符,用于精准推送广告。不填无法获取到个性化广告。
- import { advertising, identifier } from '@kit.AdsKit';
- import { common } from '@kit.AbilityKit';
- import { hilog } from '@kit.PerformanceAnalysisKit';
- import { BusinessError } from '@kit.BasicServicesKit';
- import { router } from '@kit.ArkUI';
- @Entry
- @Component
- struct Index {
- private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext;
- // 获取到的OAID
- private oaid: string = '';
- aboutToAppear() {
- try {
- // 使用Promise回调方式获取OAID
- identifier.getOAID().then((data: string) => {
- this.oaid = data;
- hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in getting adsIdentifierInfo by promise');
- }).catch((error: BusinessError) => {
- hilog.error(0x0000, 'testTag', '%{public}s',
- `Failed to get adsIdentifierInfo, code: ${error.code}, message: ${error.message}`);
- })
- } catch (error) {
- hilog.error(0x0000, 'testTag', '%{public}s', `Catch err, code: ${error.code}, message: ${error.message}`);
- }
- }
- build() {
- Row() {
- Button('加载广告', { type: ButtonType.Normal, stateEffect: true })
- .onClick(() => {
- // 调用加载广告方法
- requestAd(this.context, this.oaid);
- })
- .borderRadius(8)
- .backgroundColor(0x317aff)
- .width(90)
- .height(40)
- }
- .height('100%')
- }
- }
- /**
- * 加载广告
- *
- * @param context 上下文环境
- * @param oaid OAID信息
- */
- function requestAd(context: common.Context, oaid: string): void {
- const adRequestParam: advertising.AdRequestParams = {
- // 广告类型
- adType: 60,
- // 'testy3cglm3pj0'为测试专用的广告位ID,App正式发布时需要改为正式的广告位ID
- adId: 'testy3cglm3pj0',
- // 在AdRequestParams中添加oaid参数
- oaid: oaid,
- // 用于区分普通请求和预加载请求,默认值false代表普通请求,true代表预加载请求
- isPreload: false
- };
- const adOptions: advertising.AdOptions = {
- // 在AdOptions中添加totalDuration参数,用于设置贴片广告展示时长(贴片广告必填)
- totalDuration: 30,
- // 在AdOptions中添加placementAdCountDownDesc参数,设置贴片广告倒计时文案(可选,填写了则展示文案,不填写则只展示倒计时)
- placementAdCountDownDesc: encodeURI('VIP免广告'),
- // 是否允许流量下载 0不允许 1允许,不设置以广告主设置为准
- allowMobileTraffic: 0,
- // 是否希望根据 COPPA 的规定将您的内容视为面向儿童的内容: -1默认值,不确定 0不希望 1希望
- tagForChildProtection: -1,
- // 是否希望按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求: -1默认值,不确定 0不希望 1希望
- tagForUnderAgeOfPromise: -1,
- // 设置广告内容分级上限: W: 3+,所有受众 PI: 7+,家长指导 J:12+,青少年 A: 16+/18+,成人受众
- adContentClassification: 'A'
- };
- // 广告请求回调监听
- const adLoaderListener: advertising.AdLoadListener = {
- // 广告请求失败回调
- onAdLoadFailure: (errorCode: number, errorMsg: string) => {
- hilog.error(0x0000, 'testTag', '%{public}s',
- `Failed to request single ad, errorCode is: ${errorCode}, errorMsg is: ${errorMsg}`);
- },
- // 广告请求成功回调
- onAdLoadSuccess: (ads: Array<advertising.Advertisement>) => {
- hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in requesting single ad!');
- // 保存请求到的广告内容用于展示
- const returnAds = ads;
- // 路由到广告展示页面
- routePage('pages/PlacementAdPage', returnAds);
- }
- };
- // 创建AdLoader广告对象
- const load: advertising.AdLoader = new advertising.AdLoader(context);
- // 调用广告请求接口
- hilog.info(0x0000, 'testTag', '%{public}s', 'Request single ad!');
- load.loadAd(adRequestParam, adOptions, adLoaderListener);
- }
- /**
- * 路由跳转
- *
- * @param pageUri 要路由到的页面
- */
- async function routePage(pageUri: string, ads: Array<advertising.Advertisement | null>) {
- let options: router.RouterOptions = {
- url: pageUri,
- params: {
- ads: ads
- }
- }
- try {
- hilog.info(0x0000, 'testTag', '%{public}s', `RoutePage: ${pageUri}`);
- router.pushUrl(options);
- } catch (error) {
- hilog.error(0x0000, 'testTag', '%{public}s',
- `Failed to routePage callback, code: ${error.code}, msg: ${error.message}`);
- }
- }
- 展示广告。
在您的页面中使用AdComponent组件展示贴片广告,由媒体判断流量场景下,可以自动播放则展示广告,反之则不展示。以前贴广告为例,前贴广告播放完成后进入正片播放。您需要在entry/src/main/resources/base/profile/main_pages.json文件中添加页面,如下图所示。
您需要在media和rawfile目录下分别指定正片未播放时的预览图video_preview.PNG和对应的正片文件videoTest.mp4,如下图所示。
示例代码如下所示:- import { router, window } from '@kit.ArkUI';
- import { BusinessError } from '@kit.BasicServicesKit';
- import { advertising, AdComponent } from '@kit.AdsKit';
- import { hilog } from '@kit.PerformanceAnalysisKit';
- @Entry
- @Component
- export struct PlacementAdPage {
- // 是否竖屏
- private portrait: boolean = true;
- // 请求到的广告内容
- private ads: Array<advertising.Advertisement> = [];
- // 广告展示参数
- private adDisplayOptions: advertising.AdDisplayOptions = {
- // 是否静音,默认不静音
- mute: false
- }
- // 广告参数
- private adOptions: advertising.AdOptions = {
- // 设置贴片广告展示时长(贴片广告必填)
- totalDuration: 30,
- // 设置贴片广告倒计时文案,文案需要使用encodeURI编码(可选,填写了则展示文案,不填写则只展示倒计时)
- placementAdCountDownDesc: encodeURI('VIP免广告'),
- // 是否希望根据 COPPA 的规定将您的内容视为面向儿童的内容: -1默认值,不确定 0不希望 1希望
- tagForChildProtection: -1,
- // 是否希望按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求: -1默认值,不确定 0不希望 1希望
- tagForUnderAgeOfPromise: -1,
- // 设置广告内容分级上限: W: 3+,所有受众 PI: 7+,家长指导 J:12+,青少年 A: 16+/18+,成人受众
- adContentClassification: 'A'
- }
- // 已经播放的贴片广告数量
- private playedAdSize: number = 0;
- // 是否播放正片
- @State isPlayVideo: boolean = false;
- // 视频播放控制器
- private controller: VideoController = new VideoController();
- // 指定视频未播放时的预览图片路径
- private previewUris: Resource = $r('app.media.video_preview');
- // 指定视频播放源的路径,这里取本地视频资源
- private innerResource: Resource = $rawfile('videoTest.mp4');
- // 用于渲染右上角倒计时
- private countDownTxtPlaceholder: string = '%d | %s';
- @State countDownTxt: string = '';
- aboutToAppear() {
- const params: Record<string, Object> = router.getParams() as Record<string, Object>;
- if (params && params.ads as Array<advertising.Advertisement>) {
- this.ads = params.ads as Array<advertising.Advertisement>;
- this.adOptions = params.adOptions as advertising.AdOptions;
- this.initData();
- }
- }
- build() {
- Stack({ alignContent: Alignment.TopEnd }) {
- // AdComponent组件用于展示非全屏广告
- AdComponent({
- ads: this.ads, displayOptions: this.adDisplayOptions,
- interactionListener: {
- // 广告状态变化回调
- onStatusChanged: (status: string, ad: advertising.Advertisement, data: string) => {
- switch (status) {
- case 'onPortrait':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onPortrait');
- // 设置屏幕方向为竖屏或返回上一页
- this.setWindowPortrait();
- break;
- case 'onLandscape':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onLandscape');
- // 设置屏幕方向为横屏
- this.setWindowLandscape();
- break;
- case 'onMediaProgress':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onMediaProgress');
- break;
- case 'onMediaStart':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onMediaStart');
- break;
- case 'onMediaPause':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onMediaPause');
- break;
- case 'onMediaStop':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onMediaStop');
- break;
- case 'onMediaComplete':
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onMediaComplete');
- // 所有广告都播放完毕后,开始播放正片
- this.playedAdSize++;
- if (this.playedAdSize === this.ads.length) {
- this.isPlayVideo = true;
- }
- break;
- case 'onMediaError':
- hilog.error(0x0000, 'testTag', '%{public}s', 'Status is onMediaError');
- break;
- case 'onMediaCountdown':
- try {
- hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onMediaCountdown');
- const parseData: Record<string, number> = JSON.parse(JSON.stringify(data));
- this.updateCountDownTxt(parseData.countdownTime);
- } catch (e) {
- hilog.error(0x0000, 'testTag', '%{public}s',
- `Failed to parse data, code: ${e.code}, msg: ${e.message}`);
- }
- break;
- }
- }
- }
- })
- .visibility(!this.isPlayVideo ? Visibility.Visible : Visibility.None)
- .width('100%')
- .height('100%')
- Row() {
- if (this.countDownTxt) {
- Text(this.countDownTxt.split('').join('\u200B'))
- .fontSize(12)
- .textAlign(TextAlign.Center)
- .maxLines(1)
- .fontColor(Color.White)
- .lineHeight(12)
- .textOverflow({ overflow: TextOverflow.Ellipsis })
- .maxLines(1)
- .backgroundColor('#66000000')
- .border({ radius: 25 })
- .padding({
- left: 8,
- right: 8,
- top: 6,
- bottom: 6
- })
- .margin({ right: 16, top: 16 })
- .height(24)
- .constraintSize({ minWidth: 60, maxWidth: 100 })
- .onClick((event: ClickEvent) => {
- hilog.info(0x0000, 'testTag', '%{public}s', 'OnVipClicked, do something...');
- })
- }
- }
- .alignItems(VerticalAlign.Top)
- .justifyContent(FlexAlign.End)
- Video({
- src: this.innerResource,
- previewUri: this.previewUris,
- controller: this.controller
- })
- .visibility(this.isPlayVideo ? Visibility.Visible : Visibility.None)
- .autoPlay(this.isPlayVideo ? true : false)
- .controls(false)
- .width('100%')
- .height('100%')
- }.width('100%').height('100%')
- }
- /**
- * 设置竖屏或返回上一页
- */
- private setWindowPortrait() {
- hilog.info(0x0000, 'testTag', '%{public}s', `Set WindowPortrait, portrait: ${this.portrait}`);
- if (!this.portrait) {
- window.getLastWindow(getContext(this), (err: BusinessError, win) => {
- win.setPreferredOrientation(window.Orientation.PORTRAIT)
- });
- this.portrait = true;
- } else {
- router.back();
- }
- }
- /**
- * 设置横屏(正向)
- */
- private setWindowLandscape() {
- hilog.info(0x0000, 'testTag', '%{public}s', `Set WindowLandscape, portrait: ${this.portrait}`);
- if (this.portrait) {
- window.getLastWindow(getContext(this), (err: BusinessError, win) => {
- win.setPreferredOrientation(window.Orientation.LANDSCAPE)
- });
- this.portrait = false;
- }
- }
- private initData() {
- this.initCountDownText();
- }
- private initCountDownText() {
- const decodeText = this.decodeString(this.adOptions?.placementAdCountDownDesc as string);
- if (!this.isBlank(decodeText)) {
- this.countDownTxtPlaceholder = this.countDownTxtPlaceholder.replace('%s', decodeText);
- } else {
- this.countDownTxtPlaceholder = '%d';
- }
- }
- private updateCountDownTxt(leftTime: number) {
- hilog.info(0x0000, 'testTag', '%{public}s', `Show LeftTime: ${leftTime}`);
- this.countDownTxt = this.countDownTxtPlaceholder.replace('%d', leftTime + '');
- }
- private decodeString(str: string): string {
- if (!str) {
- return str;
- }
- let decodeUrl = str;
- try {
- decodeUrl = decodeURIComponent(str.replace(/\+/g, '%20'));
- } catch (e) {
- hilog.error(0x0000, 'testTag', '%{public}s', `Failed to decodeURIComponent, code:${e.code}, msg: ${e.message}`);
- }
- return decodeUrl;
- }
- private isBlank(str: string): boolean {
- if (str === null || str === undefined) {
- return true;
- }
- if (typeof str === 'string') {
- return str.trim().length === 0;
- }
- return false;
- }
- }
相关文章:

华为HarmonyOS打造开放、合规的广告生态 - 贴片广告
场景介绍 贴片广告是一种在视频播放前、视频播放中或视频播放结束后插入的视频或图片广告。 接口说明 接口名 描述 loadAd(adParam: AdRequestParams, adOptions: AdOptions, listener: AdLoadListener): void 请求单广告位广告,通过AdRequestParams、AdOptions…...

vue3 v-for循环子组件上绑定ref并且取值
vue3 v-for循环子组件上绑定ref并且取值 // 要循环的变量 const views ref([])// 数组存所有ref dom const itemsRef ref([])const refresh (index) > {// 取出ref dom子组件并且调用其方法itemsRef.value[index].initChart() }<div class"block" v-for&quo…...

GitHub个人主页美化
效果展示 展示为静态效果,动态效果请查看我的GitHub页面 创建GitHub仓库 创建与GitHub用户名相同的仓库,当仓库名与用户名相同时,此仓库会被视作特殊仓库,其README.md(自述文件)会展示在GitHub个人主页…...

云短信平台优惠活动
题目描述 某云短信厂商,为庆祝国庆,推出充值优惠活动。 现在给出客户预算,和优惠售价序列,求最多可获得的短信总条数。 输入描述: 第一行客户预算 M M M,其中 0 < M < 1000000 0<M<100000…...

Pyecharts使用本地文件绘制美国地图
访问我的github仓库outer_resources中的USA.json文件: big_data_analysis/outer_resources/USA.json at main Just-A-Freshman/big_data_analysis 保存到当前目录下; 随后运行代码: from pyecharts import options as opts from pyecharts.charts import Map from pyechar…...

lanqiaoOJ 3255:重新排队 ← STL list 单链表
【题目来源】https://www.lanqiao.cn/problems/3255/learning/【题目描述】给定按从小到大的顺序排列的数字 1 到 n,随后对它们进行 m 次操作,每次将一个数字 x 移动到数字 y 之前或之后。请输出完成这 m 次操作后它们的顺序。【输入格式】第一行为两个数…...

解决虚拟机启动报:此主机支持AMD-V,但AMD-V处于禁用状态
首先要知道你自己使用的主板型号,如果是京东购买的,可以直接上京东去问客服。如果没有订单号,如果能提供正确的主板型号,他们应该也是会帮忙解答的。 您好,AMD 平台与 Intel 平台以及部分新老主板开启虚拟化的步骤和细…...

【安装配置教程】二、VMware安装并配置ubuntu22.04
一、准备: 虚拟机安装ubuntu,首先要先找到一个镜像,可以去ubuntu官方下载一个,地址:下载Ubuntu桌面系统 | Ubuntu,下载好iso的镜像文件后保存好,接下来打开VMware。 二、安装ÿ…...

5G SSB(同步信号块)位于物理层
5G SSB(同步信号块)位于物理层。在5G NR中,SSB由主同步信号(PSS)、辅同步信号(SSS)和物理广播信道(PBCH)组成,这些信号共同构成了SSB。SSB的主要功能是帮…...

40.第二阶段x86游戏实战2-初识lua
免责声明:内容仅供学习参考,请合法利用知识,禁止进行违法犯罪活动! 本次游戏没法给 内容参考于:微尘网络安全 本人写的内容纯属胡编乱造,全都是合成造假,仅仅只是为了娱乐,请不要…...

官方redis安装
网址:1-https://redis.io/docs/latest/operate/oss_and_stack/install/install-redis/install-redis-on-linux/ 查看是否有redis ubantu:apt-cache policy redis-server centos:yum list redis 或 yum list installed | grep redis apt查…...

OpenEuler 使用ffmpeg x11grab捕获屏幕流,rtsp推流,并用vlc播放
环境准备 安装x11grab(用于捕获屏幕流)和libx264(用于编码) # 基础开发环境&x11grab sudo dnf install -y \autoconf \automake \bzip2 \bzip2-devel \cmake \freetype-devel \gcc \gcc-c \git \libtool \make \mercurial \pkgconfig \zlib-devel \libX11-devel \libXext…...

呼叫中心报工号功能有没有价值?有没有更好的方案?
呼叫中心报工号功能有没有价值?有没有更好的方案? 作者:开源呼叫中心系统 FreeIPCC,Github地址:https://github.com/lihaiya/freeipcc 呼叫中心报工号功能确实具有一定的价值,主要体现在以下几个方面&…...

Unity 6 基础教程(Unity 界面)
Unity 6 基础教程(Unity 界面) Unity 6 基础教程(Unity 界面)Project 窗口Project 窗口工具栏Project 窗口 创建菜单Project 窗口 搜索栏Project 窗口 Search 工具Project 窗口 类型搜索Project 窗口 标签搜索Project 窗口 保存搜…...

Vue插槽的使用场景
插槽(slot)是一种用于组件模版复用的技术,它允许你在子组件中预留一些位置,然后在父组件中填充内容。这样就可以在不同的地方使用同一个组件,但是在不同的地方显示不同的内容。 插槽主要分为默认插槽、具名插槽、动态插槽、插槽后备、作用域插…...

Redis 下载安装(Windows11)
目录 Redis工具下载安装 Redis 工具 系统:Windows 11 下载 Windows版本安装包:通过百度网盘分享的文件:Redis-x64-3.0.504.msi 链接:https://pan.baidu.com/s/1qxq0AZJe5bXeCPzm1-RBCg?pwdc14j 提取码:c14j 安装…...

求平面连接线段组成的所有最小闭合区间
这个功能确实非常实用,我在过去开发地面分区编辑器时就曾应用过这一算法。最近,在新产品的开发中再次遇到了类似的需求。尽管之前已经实现过,但由于长时间未接触,对算法的具体细节有所遗忘,导致重新编写时耗费了不少时…...

编译安装并刷写高通智能机器人SDK
The Qualcomm Intelligent Robotics Product SDK (QIRP SDK) 高通智能机器SDK基于ROS2进行开发,此SDK适用于高通linux发行版本,QIRPSDK中提供以下内容: ROS 包中用于支持机器人应用程序开发的参考代码 用于评估机器人平台的端到端场景示例集…...

软考:案例题分析1101
22年第一题:架构设计与评估 分析文字,识别需求和质量属性?这里需要记忆质量属性有那些,区分需求和质量属性,能区分出质量属性之间的区别。 我的回答: 差距分析: 根据题目中功能的特点ÿ…...

如何检查雷池社区版 WAF 是否安装成功?
容器运行状态检查: 使用命令行检查:打开终端,连接到安装雷池的服务器。运行 docker ps 命令,查看是否有与雷池相关的容器正在运行。 如果能看到类似 safeline-mgt、safeline-tengine 等相关容器,并且状态为 Up&#x…...

一周内从0到1开发一款 AR眼镜 相机应用?
目录 1. 📂 前言 2. 💠 任务拆分 2.1 产品需求拆分 2.2 开发工作拆分 3. 🔱 开发实现 3.1 代码目录截图 3.2 app 模块 3.3 middleware 模块 3.4 portal 模块 4. ⚛️ 拍照与录像 4.1 前滑后滑统一处理 4.2 初始化 View 以及 Came…...

vue3中setup的作用是什么?
Vue 3.0中的setup函数是一个全新的选项,它是在组件创建时执行的一个函数,用于替代Vue2.x中的beforeCreate和created钩子函数。setup函数的作用是将组件的状态和行为进行分离,使得组件更加清晰和易于维护。 在本文中,我们将详细讲解…...

java.io.FileNotFoundException: Could not locate Hadoop executable: (详细解决方案)
1,当你在pycharm 上运行spark代码时候出现下面这个报错。 解决方案 我们要先去hadoop的bin目录下去看看里面是否有 winutils.exe 这个错误 就是缺少winutils.exe 所以报这个错误,把它放到你的hadoop的bin目录下问题就解决了...

事件捕获vs 事件冒泡,延申事件委托
事件捕获vs事件冒泡 拿点击事件举例子,点击dom树的某个目标节点: 事件捕获:从根节点到目标节点扩散事件冒泡:从目标节点到根节点扩散 扩散就是说,途中的节点,相应的点击事件都会被触发 但是,只…...

接口测试(十一)jmeter——断言
一、jmeter断言 添加【响应断言】 添加断言 运行后,在【察看结果树】中可得到,响应结果与断言不一致,就会红色标记...

使用buildx构建多架构平台镜像
1. 查看buildx插件信息 比较新的docker-ce版本默认已经集成了buildx插件 [rootdocker ~]# docker buildx version github.com/docker/buildx v0.11.2 9872040 [rootdocker ~]#2. 增加多平台镜像构建支持 通过tonistiigi/binfmt:latest初始化一个基于容器的构建环境ÿ…...

宠物领养救助管理软件有哪些功能 佳易王宠物领养救助管理系统使用操作教程
一、概述 佳易王宠物领养救助管理系统V16.0,集宠物信息登记、查询,宠物领养登记、查询, 宠物领养预约管理、货品进出库库存管理于一体的综合管理系统软件。 概述: 佳易王宠物领养救助管理系统V16.0,集宠物信息登记…...

Spring Boot中实现多数据源连接和切换的方案
Spring Boot中实现多数据源连接和切换的方案 在Spring Boot项目中,随着业务需求的增长,我们往往需要连接多个数据库,即实现多数据源连接和切换。这种需求可能源于数据库的读写分离、微服务架构下的服务拆分、数据分库分表等场景。本文将详细…...

科技资讯|谷歌Play应用商店有望支持 XR 头显,AR / VR设备有望得到发展
据 Android Authority 报道,谷歌似乎正在为其 Play 商店增加对 XR 头显的支持。该媒体在 Play 商店的代码中发现了相关的线索,包括一个代表头显的小图标以及对“XR 头显”的提及。 谷歌也可能改变了此前拒绝将 Play 商店引入 Meta Quest 头显的决定。今…...

关于read/write 网络IO、硬盘IO的区别
对于read/write API,在数据在不超过指定的长度的时候有多少读多少,没有数据则会一直等待。 因此,对于网络IO,由于我们无法知道网络对面什么时候准备好数据,什么时候发起数据。所以使用read/write的话,可能…...