快应用 Feature

快应用 Feature

Quick App Feature API 参考

快应用(QuickApp)基于 QuickJS + LVGL + Yoga 运行在 Vela 上,通过 require('system.xxx') 调用各类 Feature 能力。

本分类的每篇文档都是融合文档:逐方法对照 openvela 仓库源码(JIDL 接口与 C/C++/Rust 实现)核实,织入 Vela 官方快应用标准文档的功能说明/示例/机型支持,以及洛汐文档库的社区补充(含开源仓库未收录的模块)。

共 45 个模块文档,见左侧「Feature API」目录。每篇文末列有「参考来源」。

快速开始

// manifest.json 的 features 中声明后,JS 侧调用:
const audio = require('system.audio')
audio.src = '/resource/music.mp3'
audio.play

应用框架、路由与页面交互

模块功能
system.router页面路由(push/replace/back/clear/getLength/getState/getPages,引擎内置)
system.app应用信息与控制(getInfo/canIUse/terminate/loadLibrary,引擎内置)
system.eventuORB 事件总线(发布/订阅)
system.promptToast 提示与 Dialog 对话框
system.internal.messagecenter内部消息中心(社区资料)

设备信息与系统设置

system.device(设备信息)、system.settings(系统属性读写订阅)、system.configuration(语言区域)、locale、system.brightness(亮度)、system.vibrator(振动)、system.battery(电池)、system.internal.power(关机/重启)。

网络、定位与设备互联

system.fetch(HTTP 请求)、system.request(下载)、system.network(网络状态)、system.geolocation(GNSS 定位)、system.interconnect(与手机 miwear 互联)、system.mqttmessage / system.mqtt(MQTT)、system.exchange(跨应用数据交换)、service.wechat(微信 SDK 桥接)、service.miaccount(小米账号)。

蓝牙

system.bluetooth(适配器,v1.0 同步 / v2.0 异步两版对照)、system.bluetooth.ble(BLE 低功耗蓝牙,广播/扫描/GATT)。

多媒体与音频

system.audio(音频播放)、system.record(录音)、system.volume(媒体音量)、system.media.session(媒体会话)、system.media(图片预览)、system.media.audio(Rust 实现音轨)。

文件、数据与安全

system.file(文件/目录,internal:// URI)、system.storage(键值存储)、system.zip / system.zlib(压缩解压)、system.crypto / system.cipher(哈希/加解密/签名)、system.digitalkey(数字钥匙)。

传感器、健康与调度

system.sensor(传感器订阅)、service.health(健康数据)、system.schedule(定时任务)。

AI 与动效

system.ai.speech(AI 语音识别 ASR)、system.folme(动效引擎)。

错误码与测试

Error(错误码转字符串,libuv uv_strerror)、event_test(事件/接口/继承机制测试桩)。

参考来源

  • openvela 源码实证:对照 openvela 源码(frameworks/runtimes/feature、frameworks/multimedia/media/feature、frameworks/connectivity/bluetooth/feature、Rust 模块、引擎内置)逐方法核实
  • Vela 官方快应用标准文档(zh 快照)
  • 洛汐文档库 https://docs.luoxe.cn/ (社区资料,含开源版未收录模块)

大纲