Overview
- Skill Key
- hefuwei-95/yzturbo-web-android
- Author
- hefuwei-95
- Source Repo
- openclaw/skills
- Version
- -
- Source Path
- skills/hefuwei-95/yzturbo-web-android
- Latest Commit SHA
- 012f7bb0834aa8c1e02c79be8a4e9a7378a8c669
YZTurboWebAndroid 高性能 Android WebView 容器 SDK 接入。用于在 Android 项目中集成 WebView 容器,实现: (1) WebView 预加载与复用,提升 H5 页面加载速度 (2) 离线包管理,拦截请求优先命中本地资源 (3) JS Bridge 双向通信,Native 与 H5 互调 适用场景:Android App 接入 H5 页面、需要离线包能力、需要 JS 通信的业务
Stars
0
Installs
0
Status
ACTIVE
Visibility
PUBLIC
直接复制以下提示词,发送给你的 AI 助手即可完成安装。
请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 yzturbo-web-android 技能。 若已安装,则直接安装 yzturbo-web-android 技能。
# YZTurboWebAndroid
Android 高性能 WebView 容器解决方案,支持 WebView 复用、离线包管理、JS Bridge 通信。
## 初始化配置
在 `Application` 中初始化:
```kotlin
class MyApplication : Application() {
override fun onCreate() {
super.onCreate()
WebViewLoader.INSTANCE.init(
WebViewLoaderConfig.Builder(getApplication())
.appKey("retail") // 应用标识
.poolSize(2) // WebView 池大小
.preloadUrl("https://xxx.com/m")
.build()
)
}
}
```
添加依赖:
```groovy
dependencies {
implementation 'com.youzan.turboweb:turbo-web:1.0.1'
}
```
## 使用 WebViewFragment(推荐)
### 基础用法
```kotlin
class WebActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_web)
if (savedInstanceState == null) {
val fragment = WebViewFragment().apply {
arguments = Bundle().apply {
putString("web_view_url", "https://your-domain.com/path")
putString("web_view_title", "页面标题")
putBoolean("show_title_bar", true)
putBoolean("show_progress_bar", true)
}
}
supportFragmentManager.beginTransaction()
.replace(R.id.container, fragment)
.commit()
}
}
}
```
### 继承定制
```kotlin
class MyWebFragment : WebViewFragment() {
override fun onPageReady() {
super.onPageReady()
// 页面加载完成后的自定义逻辑
}
}
```
## 手动管理 WebView(进阶)
```kotlin
// 1. 获取 WebView(复用池中有可用则复用)
val (webView, isReused) = WebViewLoader.acquireWebView(
context = this,
url = "https://your-domain.com/app/path",
listener = object : WebViewListener {
override fun onPageFinished(view: WebView?, url: String?) {}
}
)
// 2. 添加...
capt-marbles
Task Router
capncoconut
Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay, check marketplace stats, or manage agent credentials. Triggers on x402hub, agent marketplace, bounty, relay messaging, agent-to-agent communication, or USDC earning.
capevace
Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.
captchasco
OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.
carol-gutianle
name: modelready description: Start using a local or Hugging Face model instantly, directly from chat. metadata: {"openclaw":{"requires":{"bins": "bash", "curl" }, "env": "URL" }}
canbirlik
Controls Wiz smart bulbs (turn on/off, RGB colors, disco mode) via local WiFi.