随笔分类 -  鸿蒙app开发·功能篇

鸿蒙开发这种常见的功能实现与案例
摘要:状态栏设置下载进度条通知 /** * @Description: 下载进度条状态栏通知class */ import { notificationManager } from '@kit.NotificationKit'; import { BusinessError } from '@kit.Ba 阅读全文
posted @ 2026-04-24 11:18 带头大哥d小弟 阅读(5) 评论(0) 推荐(0)
摘要:import { AppUtil, ToastUtil } from '@pura/harmony-utils'; import { DownloadManager, UploadManager, DownloadConfig, DownloadListener, DownloadTask, Dow 阅读全文
posted @ 2026-03-19 11:24 带头大哥d小弟 阅读(6) 评论(0) 推荐(0)
摘要:import { Log } from '@abner/log'; import wifiManager from '@ohos.wifiManager'; import { StringUtils } from '../StringUtils'; class wifiManagerUtil { i 阅读全文
posted @ 2026-01-16 16:54 带头大哥d小弟 阅读(9) 评论(0) 推荐(0)
摘要:emitter工具函数class /** * @Author: * @Date: 2025.11.19 * @Description: emitter环境与函数 */ import { emitter } from '@kit.BasicServicesKit'; export class Emit 阅读全文
posted @ 2026-01-16 10:38 带头大哥d小弟 阅读(4) 评论(0) 推荐(0)
摘要:tcp消息发送,模拟队列版本 /** * @Author: * @Date: 2026.01.15 * @Description: TCP Socket send队列封装管理class */ import { BusinessError } from '@kit.BasicServicesKit'; 阅读全文
posted @ 2026-01-15 16:46 带头大哥d小弟 阅读(8) 评论(0) 推荐(0)
摘要:将普通不可观察数据变为可观察数据 、、、 UIUtils.makeObserved('对象、接口对象') 、、、 使V1的状态变量能够在@ComponentV2中观察 、、、 mport { UIUtils } from '@kit.ArkUI'; @Observed class ObservedC 阅读全文
posted @ 2025-12-02 09:22 带头大哥d小弟 阅读(9) 评论(0) 推荐(0)
摘要:获取系统语言、地域、国家函数。 // 获取系统语言 let systemLanguage: string = i18n.System.getSystemLanguage(); // systemLanguage为当前系统语言 // 获取系统地区 let systemRegion: string = 阅读全文
posted @ 2025-11-28 13:37 带头大哥d小弟 阅读(12) 评论(0) 推荐(0)
摘要:分享工具 点击查看代码 import { systemShare } from '@kit.ShareKit'; import { uniformTypeDescriptor as utd } from '@kit.ArkData'; import { common } from '@kit.Abi 阅读全文
posted @ 2025-11-12 16:22 带头大哥d小弟 阅读(14) 评论(0) 推荐(0)
摘要:1、从图库获取视频和图片,返回uri合集 点击查看代码 private selectMedia(mediaType: string = "image"): Promise<string> { const photoSelectOptions = new photoAccessHelper.Photo 阅读全文
posted @ 2025-11-12 14:00 带头大哥d小弟 阅读(33) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-10-09 16:34 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
摘要:第一步:权限申请 在module.json5中进行如下配置; "requestPermissions": [ { "name": "ohos.permission.PRINT", "reason": "$string:permissionsReason", "usedScene": { "abili 阅读全文
posted @ 2025-10-08 19:06 带头大哥d小弟 阅读(18) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-06-18 16:22 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-06-16 15:14 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-06-15 18:19 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-05-19 15:09 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-05-15 20:24 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-05-07 21:31 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-05-06 22:00 带头大哥d小弟 阅读(0) 评论(0) 推荐(0)
摘要:①后台长时任务 通过backgroundTaskManager的startBackgroundRunning接口,通过ability上下文,任务类型(音视频、语音等)、定义动作属性(拉起的ability)开启后台任务,并用backgroundTaskManager.stopBackgroundRun 阅读全文
posted @ 2025-05-04 20:06 带头大哥d小弟 阅读(5) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2025-05-02 11:33 带头大哥d小弟 阅读(2) 评论(0) 推荐(0)